Open escamoteur opened 4 months ago
OK, so record literal flow analysis differs for the two tools. I'd assume that the more detailed analysis is the desired one, which motivates the use of 'area-front-end'. It is surprising to me that the flow analysis differs, but this might be because the ongoing unification hasn't reached the flow analysis yet.
@johnniwinther, do you agree on this description, and the classification as 'area-front-end'?
@stereotype441, WDYT?
@eernstg what would be the correct behaviour according to the language spec? Should one !
be enough?
We don't have a finalized specification of the flow analysis. See flow-analysis.md for some information about it.
The reason why we'd prefer the analysis where the second !
isn't required is that (1) it is sound, (2) it is less verbose, less redundant, and (3) we already rely on flow analysis to detect similar ordering guarantees in the evaluation of expressions. So one !
should be enough.
So the compiler and not the analyzer has the problem. Am 16. Mai 2024, 15:36 +0200 schrieb Erik Ernst @.***>:
We don't have a finalized specification of the flow analysis. See flow-analysis.md for some information about it. The reason why we'd prefer the analysis where the second ! isn't required is that (1) it is sound, (2) it is less verbose, less redundant, and (3) we already rely on flow analysis to detect similar ordering guarantees in the evaluation of expressions. So one ! should be enough. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
on a side note, (not sure if that would be possible) but I see a difference between using an !
on a non-nullable type to which the analyzer should complain and using a second !
in a case like the above.
I just stumbled upon this here
The analyzer doesn't tell me that I need a
!
or?
witha.j
but the compiler complains. If I add a second!
the analyzer complains that it is not needed.This only happens with records. I tried first to reproduce what I found in our project by assigning to variables. There the compiler didn't complain.
Here we get the problem
but with
the compiler doesn't complain