As a result of merging #263 , a different bug has been created.
However, instead of fixing that in that PR, we should fix it separately since it would slightly change the structure of the checker.
When using an alias, the type checker trips up as it assumes that the alias should be in the environment.
Instead, it should add these to the environment.
How to Reproduce
with my_resource as other do
do_something(other)
Gives:
Error: [error | type] Undefined variable: other
--> path/to/file:5:21
5 | with my_resource as other do
^^^^^
6 | do_something(other)
Expected behavior
When in type alias mode, the variables should be added to the environment instead of erroing if they are not there.
Description of Bug
As a result of merging #263 , a different bug has been created. However, instead of fixing that in that PR, we should fix it separately since it would slightly change the structure of the checker.
When using an alias, the type checker trips up as it assumes that the alias should be in the environment. Instead, it should add these to the environment.
How to Reproduce
Gives:
Expected behavior
When in type alias mode, the variables should be added to the environment instead of erroing if they are not there.