run
breaks type safety
#2068
Labels
Bug
The observed behaviour is incorrect or unexpected.
L-Type system
Issues related to the Swarm language type system.
Describe the bug
Executing
run
can overwrite existing definitions with new definitions having different types. This can break type safety if the overwritten names were used in the same expression.To Reproduce
Create a file
m.sw
:Now, in a Creative mode game:
Results in a
Fatal error: bad application of execConst...
Expected behavior
I don't even know what is expected. This is just yet more evidence that
run
is broken; see #495 . This would not be a problem with a properimport
command since the secondm
would be typechecked with the type it has inm.sw
, as it should.Additional context
I thought of this when reading @xsebek's clever hacks in #2064 😄
The text was updated successfully, but these errors were encountered: