gracelang / minigrace

Self-hosting compiler for the Grace programming language
39 stars 22 forks source link

Allow expressions in type-arguments #291

Closed IsaacOscar closed 5 years ago

IsaacOscar commented 5 years ago

This is a fix for #41 and #242. However, it now has the bug of #289. In particular, the following code prints "true" and "false":

method foo[[T]] { print(T.matches(3) && T.matches("3")) }
foo[[String|Number]]
foo[[1 + 2]]

Previously, both calls to foo were syntax errors. However, according to the [grammar],(https://github.com/gracelang/language/blob/master/languageSpec/graceGrammar.txt) only the second one should be.