neugram / ng

scripting language integrated with Go
https://neugram.io
BSD 2-Clause "Simplified" License
917 stars 43 forks source link

typecheck: support for named return parameters #184

Closed sbinet closed 6 years ago

sbinet commented 6 years ago

the following fails in ng:

ng> func f() (result int) {
..> return result
..> }
ng: typecheck: undeclared identifier: result
crawshaw commented 6 years ago

I think the parser does support named return types (at least, I recall spending a long time on it), the problem is the typechecker not loading them into the scope.