ooc-lang / rock

:ocean: self-hosted ooc compiler that generates c99
http://ooc-lang.org/
MIT License
401 stars 40 forks source link

Rock parses function arguments with default values incorrectly #990

Open marcusnaslund opened 8 years ago

marcusnaslund commented 8 years ago

All of these should of course be equal, but are unfortunately not:

foo: func (a := false, b := true) // works
moo: func (a: Bool = false, b := true) // works
bar: func (a := false, b: Bool = true) // does not work
car: func (a: Bool = false, b: Bool = true) // does not work

For example, bar fails with error Couldn't unwrap decl 'false: Bool', which suggests rock parses something incorrectly.

alexnask commented 8 years ago

Huh, weird.
Will be looking into it.