-
Notifications
You must be signed in to change notification settings - Fork 78
Description
While updating the SAWScript parser in #2748, I realized that we parse SAWScript types as right-associative in constructor applications - so a type written as TopLevel Int Int (such as in intTests/test_type_errors/err034.saw) is parsed as TopLevel (Int Int). Pre-#2748, TopLevel Int Int wouldn't make it past the parser, but with that PR's changes, it will.
I think we'd much rather treat type constructor applications as left-associative, and I think err034.saw as written already expects that we do that. I don't think we have any * -> * -> * types, but if we did, it would seem pretty odd to mandate that they be written out as (TC t1) t2, rather than allowing TC t1 t2.
With #2748's changes to the AppliedType parsing rule (in Parser.y), changing this associativity should be pretty trivial.