vapourlang / vapour

Typed superset of R
http://vapour.run
Apache License 2.0
194 stars 3 forks source link

Type checker does not verify symbol existence during assignment #74

Closed ElianHugh closed 1 month ago

ElianHugh commented 1 month ago

Hello again, I've been playing around with vapour and ran into a small issue.

Consider the following:

let foo: bar = baz
foo = baz # baz not found
foo = 1 # left expects `bar`, right returns `int`

It seems that the checker is inferring that the symbols exist during the assignment. I would expect that the first error would be that the type bar does not exist, and then that the value baz doesn't exist. However, it appears that this is checked only after variable assignment.

JohnCoene commented 1 month ago

Hi Elian,

Thanks so much for all the issues you've opened, it's really helpful! (some are already tackled on branch v0.0.6).

Will look into:

JohnCoene commented 1 month ago

Will be fixed in v0.0.6, thanks again for sharing!

https://github.com/vapourlang/vapour/blob/7cb944757215c047ea66683ab453d47234dd48e3/walker/walk_test.go#L1359

ElianHugh commented 1 month ago

No worries, excited to see the progress!