fix: SetConFieldType could create ill-typed programs#932
Conversation
47ee50c to
b45410a
Compare
|
We hadn't noticed this before because this action is rarely exercised. In particular, it is not part of the OpenAPI, and is never an "offered" action. Thus it does not participate in our property tests which check all offered actions are actually accepted (whilst that runs with smartholes, and this bug only happens because we don't do a smartholes pass, it still would have been caught since the test checks that the result is well-formed (with SH) and that that final TC pass did not change the program, in @georgefst I believe you were looking into exposing the typedef actions via the OpenAPI. Will that make them "offered" actions, and thus be part of the existing pbt? (If not, what's your plan / what is needed to get them tested in our existing test?) |
The tests all currently pass since we don't require the programs actually be well typed. We change the tests so that they operate on well typed programs now.
Currently we don't require these test cases to be well typed, so they pass. We adjust them to bind the correct number of fields in case expressions even though this is not technically required currently.
This makes the test align to our bidirectional typing discipline. This is not enforced by our testsuite currently, but is good for futureproofing.
Let's not have testcases which are not even well-scoped.
(This is not enforced by the testsuite)
5ceed37 to
d240f8d
Compare
Yes. That should mean that almost all of |
When running this action, we don't run a full typechecking pass (for efficiency). Prior to this commit we could create ill-typed programs, by not taking into account directionality, since arguments to constructors may only be checkable, but the action may wrap those terms in a hole without adding an annotation.
d240f8d to
c76d3ac
Compare
When running this action, we don't run a full typechecking pass (for efficiency). Prior to this commit we could create ill-typed programs, by not taking into account directionality, since arguments to constructors may only be checkable, but the action may wrap those terms in a hole without adding an annotation.
Note that this would have been fixed in a different way by #931.