Closed bakkot closed 10 months ago
You should add support for undefined/booleans.
You should add support for undefined/booleans.
Done.
It looks like you're missing some coverage in the tests. For example, I don't see anything for EcmaScript language values. I would expect the whole dominator lattice to be tested.
Catches errors like https://github.com/tc39/proposal-joint-iteration/pull/11#discussion_r1442155330 via a very basic type system.
The checks only apply to call arguments, and specifically only to arguments which are either literals or themselves calls (including
! Foo()
-style unwrapped calls). There's no tracking of variables or anything yet.Also, we can't generally infer types precisely. For example, imagine
Identity(x)
which returns its input and accepts any value:TakesInteger(Identity(42))
would be a reasonable thing to write, but the type system here is much to weak to know that. So we check only that the intersection (that is, the meet) of the argument type and parameter type is nonempty.The first commit is just moving code around. I recommend reviewing commits individually.