Go indexer: Don't fail on unresolved function types.
Summary:
When a function type is unresolved, don't try to emit parameter bindings for it
(since they won't be known).
Reviewers: #core_team, zarko
@@ -175,9 +175,10 @@ func (e *emitter) visitFuncLit(flit *ast.FuncLit, stack stackFunc) {
e.pi.function[flit] = info
e.writeDef(flit, info.vname)
- sig := e.pi.Info.Types[flit].Type.(*types.Signature)
+ if sig, ok := e.pi.Info.Types[flit].Type.(*types.Signature); ok {
e.emitParameters(flit.Type, sig, info)
}
+}
// visitValueSpec handles variable and constant bindings.
func (e *emitter) visitValueSpec(spec *ast.ValueSpec, stack stackFunc) {
