Open eernstg opened 2 years ago
@scheglov, do you agree that the CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER
issue that seems to affect the analysis of every enhanced enum declaration could mask errors on the enum members? Is it expected to be resolved soon?
Yes, I agree. https://dart-review.googlesource.com/c/sdk/+/230321 should fix this.
Thanks! I added https://github.com/dart-lang/sdk/issues/48237 just in case there is a need to change the analyzer as well.
Consider the following program:
The program uses
--enable-experiment=enhanced-enums
. It does not have any errors, in particular,[]
can be used as an actual argument because the spec has:However, the CFE reports an error at
[]
(two, actually):The analyzer rejects the program as follows:
which means that the analyzer may or may not have the same fault, but we don't get to see it because we encounter an error with the
Enum
constructor (which could be a fault in the analyzer, or in the declaration ofEnum
, or both).So we have at least one platform where there is a need to make this change: An enum value declaration is a constant context.
Subtasks: