File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
go/analysis/passes/stringintconv Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import (
15
15
"golang.org/x/tools/go/analysis/passes/inspect"
16
16
"golang.org/x/tools/go/analysis/passes/internal/analysisutil"
17
17
"golang.org/x/tools/go/ast/inspector"
18
+ "golang.org/x/tools/internal/aliases"
18
19
"golang.org/x/tools/internal/typeparams"
19
20
)
20
21
@@ -194,16 +195,15 @@ func run(pass *analysis.Pass) (interface{}, error) {
194
195
195
196
func structuralTypes (t types.Type ) ([]types.Type , error ) {
196
197
var structuralTypes []types.Type
197
- switch t := t .(type ) {
198
- case * types.TypeParam :
199
- terms , err := typeparams .StructuralTerms (t )
198
+ if tp , ok := aliases .Unalias (t ).(* types.TypeParam ); ok {
199
+ terms , err := typeparams .StructuralTerms (tp )
200
200
if err != nil {
201
201
return nil , err
202
202
}
203
203
for _ , term := range terms {
204
204
structuralTypes = append (structuralTypes , term .Type ())
205
205
}
206
- default :
206
+ } else {
207
207
structuralTypes = append (structuralTypes , t )
208
208
}
209
209
return structuralTypes , nil
You can’t perform that action at this time.
0 commit comments