ooc-lang / rock

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

Add safe navigation accesses to the language #944

Closed alexnask closed 8 years ago

alexnask commented 8 years ago

See fasterthanlime/nagaqueen#28

Tests are needed and the syntax is still not 100% ideal but I think we can agree this is a nice feature to have, especially in conjunction with the nullco ?? operator.

Also, we should probably do some typechecking in SafeNavigation (we shouldn't allow any access to be on a non-pointer type), which involves resolving the accesses there and only adding the variable decl and comma sequence after we make sure we can resolve everything.

alexnask commented 8 years ago

180 tests!
We've come a long way :)

fasterthanlime commented 8 years ago

:rocket: :dizzy: