Skip to content

Commit

Permalink
Skip synthetic functions
Browse files Browse the repository at this point in the history
  • Loading branch information
chriso committed Dec 16, 2023
1 parent 66bafb6 commit db8dbb6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion compiler/compile.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,9 @@ func (c *compiler) compile(path string) error {
}
}
if pkg == nil {
if fn.Synthetic != "" {
continue
}
return fmt.Errorf("unsupported yield function %s (Pkg is nil)", fn)
}

Expand Down Expand Up @@ -320,7 +323,7 @@ func (c *compiler) compilePackage(p *packages.Package, colors functionColors) er
case *ast.FuncDecl:
case *ast.FuncLit:
default:
return fmt.Errorf("unsupported yield function %s (Syntax is %T, not *ast.FuncDecl or *ast.FuncLit)", fn, decl)
continue
}
colorsByFunc[decl] = color
}
Expand Down

0 comments on commit db8dbb6

Please sign in to comment.