-
Couldn't load subscription status.
- Fork 567
Closed
Description
- There is a func that takes a func as an argument.
- Call the func with anonymous function within if statement and user return value.
- Parser stops from end of the function
Here is a sample code.
package main
import "errors"
func bar(fn func() int) error {
if fn() != 42 {
errors.New("Not a answer for everything!")
}
return nil
}
func main() {
if err := bar(func() int {return 42}); err != nil {
panic(err)
}
// After here, parser stops and both function hilighting and auto-indentation doesn't work.
print("You find answer for everything.\n")
another()
}
func another() {
// parser now works again
print("Congraturation!")
}