We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents be58ca3 + 4f1a712 commit 0050491Copy full SHA for 0050491
bind/package.go
@@ -337,8 +337,15 @@ func (p *Package) process() error {
337
funcs[name] = fv
338
339
case *types.TypeName:
340
- named := obj.Type().(*types.Named)
341
- switch typ := named.Underlying().(type) {
+ typ := obj.Type()
+ if named, ok := typ.(*types.Named); ok {
342
+ typ = named.Underlying()
343
+ } else {
344
+ // we are dealing with a type alias to a type literal.
345
+ // this is a cursed feature used to do structural typing.
346
+ // just pass it as-is.
347
+ }
348
+ switch typ := typ.(type) {
349
case *types.Struct:
350
sv, err := newStruct(p, obj)
351
if err != nil {
0 commit comments