Open arthurrump opened 1 month ago
Thanks for this concise report and the analysis @arthurrump ; we'll look into this. To me it seems like the dynamic type is confused with the static type somewhere.
The interpreter does both an abstract interpretation and a concrete interpretation at the same time to simulate the behavior of the (then) future static checker to some degree. That sometimes led to confusion.
Describe the bug
results in the error
|file:///.../Example.rsc|(127,1,<10,17>,<10,18>): Expected set[void], but got set[int]
. It looks like the empty set in the initialize function is inferred to be aset[void]
and this overrides the type ofnumbers
.Immediately initializing the
numbers
variable fixes the issue:To Reproduce
Copy the module above to a file and run the main method.
Expected behavior
I expect this code to run without errors :) I found this in an old project, so I suppose it worked in some previous versions.
Stack traces
Desktop (please complete the following information):