Skip to content

Commit f2a35ab

Browse files
committed
Fix type aliases to basic types
1 parent ca3c581 commit f2a35ab

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

bind/gen.go

+8-2
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,10 @@ func (g *Generator) Init() {
146146
g.funcs = append(g.funcs, obj)
147147
}
148148
case *types.TypeName:
149-
named := obj.Type().(*types.Named)
149+
named, ok := obj.Type().(*types.Named)
150+
if !ok {
151+
continue
152+
}
150153
switch t := named.Underlying().(type) {
151154
case *types.Struct:
152155
g.structs = append(g.structs, structInfo{obj, t})
@@ -180,7 +183,10 @@ func (g *Generator) Init() {
180183
continue
181184
}
182185
if obj, ok := obj.(*types.TypeName); ok {
183-
named := obj.Type().(*types.Named)
186+
named, ok := obj.Type().(*types.Named)
187+
if !ok {
188+
continue
189+
}
184190
if t, ok := named.Underlying().(*types.Interface); ok {
185191
g.allIntf = append(g.allIntf, interfaceInfo{obj, t, makeIfaceSummary(t)})
186192
}

0 commit comments

Comments
 (0)