Skip to content

Commit

Permalink
Merge pull request #1070 from cogentcore/go-parse
Browse files Browse the repository at this point in the history
avoid crash in golang parsing
  • Loading branch information
kkoreilly authored Jul 28, 2024
2 parents 3b23f5e + 11d2997 commit 89c1101
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions parse/languages/golang/typeinfer.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,11 @@ func (gl *GoLang) InferSymbolType(sy *syms.Symbol, fs *parse.FileState, pkg *sym
if ffc.Name == "Name" {
ffc = ffc.NextAST()
}
vty, ok := gl.TypeFromAST(fs, pkg, nil, ffc)
if ok {
var vty *syms.Type
if ffc != nil {
vty, _ = gl.TypeFromAST(fs, pkg, nil, ffc)
}
if vty != nil {
sy.Type = SymTypeNameForPkg(vty, pkg)
} else {
sy.Type = TypeErr
Expand Down

0 comments on commit 89c1101

Please sign in to comment.