From 4e94ff0e564f22b31af1b019b4f64c0efddee322 Mon Sep 17 00:00:00 2001 From: Anton Telyshev Date: Sun, 9 Jun 2024 00:01:14 +0300 Subject: [PATCH] Don't use 1.22 features (`types.Unalias`) (#120) * Don't use 1.22 features * fix comment --- internal/checkers/printf/printf.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/checkers/printf/printf.go b/internal/checkers/printf/printf.go index 4f6e3f9c..cfb47b54 100644 --- a/internal/checkers/printf/printf.go +++ b/internal/checkers/printf/printf.go @@ -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 } @@ -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 }