Open kostmo opened 9 months ago
One slight practical difficulty is that we do not currently pass along the set of existing entities during typechecking. An alternative idea would be to check this in a separate pass, after typechecking has succeeded --- traverse through the term just looking for literal text arguments to functions that expect entities, and make sure they are known.
If we ever do #455 it would certainly change what this looks like, but that need not stop us implementing this useful (and hopefully not too difficult) check in the meantime.
In a
.sw
program, when we encounter a line:given the context of a scenario, we should be able to check statically whether
"foo"
refers to an existing entity.Entities are defined both globally and on a per-scenario basis.
.sw
files..sw
programs are parsed at scenario-load time (e.g. with--autoplay
or--run
), could return immediate failure on incorrect entity name arguments instead of deferring failures to runtime.Also related: #1301