Skip to content

Commit

Permalink
Don't use 1.22 features (types.Unalias) (#120)
Browse files Browse the repository at this point in the history
* Don't use 1.22 features

* fix comment
  • Loading branch information
Antonboom authored Jun 8, 2024
1 parent 1164965 commit 4e94ff0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/checkers/printf/printf.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,9 @@ func isFormatter(typ types.Type) bool {
types.Identical(sig.Params().At(1).Type(), types.Typ[types.Rune])
}

// isTypeParam reports whether t is a type parameter (or an alias of one).
// isTypeParam reports whether t is a type parameter.
func isTypeParam(t types.Type) bool {
_, ok := types.Unalias(t).(*types.TypeParam)
_, ok := t.(*types.TypeParam)
return ok
}

Expand All @@ -224,7 +224,7 @@ func isTypeParam(t types.Type) bool {
// This function avoids allocating the concatenation of "pkg.Name",
// which is important for the performance of syntax matching.
func isNamedType(t types.Type, pkgPath string, names ...string) bool {
n, ok := types.Unalias(t).(*types.Named)
n, ok := t.(*types.Named)
if !ok {
return false
}
Expand Down

0 comments on commit 4e94ff0

Please sign in to comment.