albrow / fo

An experimental language which adds functional programming features to Go.
Other
1.24k stars 34 forks source link

Error using defined type as generic argument #18

Closed cosmos72 closed 6 years ago

cosmos72 commented 6 years ago

First of all, kudos for the cool project! It's good to see other experiments with Go generics :)

Now, the error report.

While the default code in play.folang.org uses Box[string] and works fine, if I change it to use Box[S], where S is declared either type S string or type S = string, the playground gives the following errors:

In https://play.folang.org/p/jqI3lQwKMFH : using Box[S] with type S string prog.go:4:9: syntax error: unexpected go, expecting name

In https://play.folang.org/p/M94uycdoV5n : using Box[S] with type S = string prog.go:10:10: undefined: Box__S

albrow commented 6 years ago

Thank you for reporting this. Just fixed it in bf31a53d129270fa8ef47ca58e2be21e3a01f144.

Here's a new Playground example with both named types and type aliases working.