This moves the type check for storage vars out of the parser and into the type checker.
The check is done after custom types have been lowered, so checks like ty.is_bool() will work, even if they're aliases. This wasn't possible at the parse stage.
It also ensures that custom types are lowered for storage vars (they didn't have to be until now -- the parser used to reject them) and they are also lowered for flattening.
Argh, the diff is a bit confused because I refactored the instance type checking into their own methods and then put the storage checks where it used to be...
Closes #745.
Note: this is based on #758 and should probably be merged after it's in.
This moves the type check for storage vars out of the parser and into the type checker.
The check is done after custom types have been lowered, so checks like
ty.is_bool()
will work, even if they're aliases. This wasn't possible at the parse stage.It also ensures that custom types are lowered for storage vars (they didn't have to be until now -- the parser used to reject them) and they are also lowered for flattening.
Argh, the diff is a bit confused because I refactored the instance type checking into their own methods and then put the storage checks where it used to be...
Closes #745.
Note: this is based on #758 and should probably be merged after it's in.