Closed btracey closed 5 years ago
True, gophernotes is more relaxed than compiled Go in this case: it does not check that functions with return values actually end with a "terminating statement" (a return, goto, infinite loop...).
The exact specs of what constitutes a "terminating statement" are a bit complex - see https://golang.org/ref/spec#Function_declarations and https://golang.org/ref/spec#Terminating_statements
If I have time, I will work on this, but since it's in the realm "accept invalid code" I consider it lower priority than bugs where gophernotes rejects valid code.
If you look at it from another angle, one may even argue that it's a gophernotes language extension - although an involuntary one.
The cell
f := func(x []float64) float64 {}
does not end with a compile error.