Conversation
|
This looks like the right idea to me. I can't think of a reason that it would go wrong with continuation attachments. If it can, it seems like it would be a general cp0 issue with the The flag is not intended to be constrained to primitives, so it should be fine if the target of the call is created with |
|
I was worried about Lines 540 to 544 in 73803e1 |
|
I see. There are no uses of continuation marks/attachments in any primitives, so I think this is ok for primitives. It complicates adding the |
|
I'll take a look and post a not-draft version is a few days. About |
42c7e3b to
4822d4b
Compare
|
Updated. I still don't like I didn't update the release notes. This seams to be too internal. But if you prefer, I can add something like The type recovery pass now marks primitive calls with type error with the no-return flag, so other passes of the compiler can notice that they will raise an error. |
|
You're looking for an alternate name of the variable I can appreciate the feeling that the change is too small to mention, but given the current conventions, I would be inclined add a little more to the current "Type recovery improvements" first sentence — maybe something like |
|
For no-return |
When cptypes detects an error in a call to a primitive, it adds the no-return flag so the other passes can use it.
4822d4b to
c51cb07
Compare
|
Fixed, renaming to |
There are a few things that I don't understand, so this is more a long question with a proof of concept than a finished PR.
When
cptypesdetects an error that is not obvious, use$app/no-returnso the other passes can notice it. Butcp0transform$app/no-returnto special flags inpreinfo, so let's add the flags directly instead.After this change, in the second leap
cp0can notice thatcptypesdetected an error and apply more reductions. See the example at the bottom of cptypes.ms Also, there is an old example incp0.msthat has type problems on purpose, and is broken with an explicit use of$app/no-return.I'm worry that this is wrong for some primitives that write/read the continuation attachment. Is there an obvious example? Is there a not obvious example?
Is it wrong with
lambdasinstead of primitives? I'm almost sure it is, but I'd like to see an example to be sure what to care about . (Anyway, probablylambdaswill be left for a PR in the future.)If this make sense and is (almost) correct, I'd like to take a look if the same change can be applied in more parts of
cptypes, and do some refactor and cleanup.