-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
P3A lower priority bug or feature requestA lower priority bug or feature requestarea-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.devexp-uxtype-enhancementA request for a change that isn't a bugA request for a change that isn't a bug
Description
Consider this code:
class Foo {
const Foo(this.x);
final int x;
}
void test(int x) {
const Foo(x);
}
void main() { }
I would expect one error message, namely, "Arguments of a constant creation must be constant expressions" or some variant thereof. However, today we get two errors, and the first one is really confusing:
error • A value of type 'Null' can't be assigned to a parameter of type 'int' in a const constructor • test.dart:7:13 • const_constructor_param_type_mismatch
error • Arguments of a constant creation must be constant expressions • test.dart:7:13 • const_with_non_constant_argument
bernaferrari, kevin-sakemaer, LaysDragon, tomtanti, wujek-srujek and 7 more
Metadata
Metadata
Assignees
Labels
P3A lower priority bug or feature requestA lower priority bug or feature requestarea-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.devexp-uxtype-enhancementA request for a change that isn't a bugA request for a change that isn't a bug