Skip to content

Commit 9e2f112

Browse files
bwilkersoncommit-bot@chromium.org
authored andcommitted
Improve the message for default_list_constructor
Change-Id: Id2514bd9aab667939396b26f677577ff3b6695fe Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150692 Reviewed-by: Konstantin Shcheglov <[email protected]> Commit-Queue: Brian Wilkerson <[email protected]>
1 parent 20fb8cb commit 9e2f112

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

pkg/analyzer/lib/src/error/codes.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1547,8 +1547,10 @@ class CompileTimeErrorCode extends AnalyzerErrorCode {
15471547
// var l = List.generate(3, (i) => i);
15481548
// ```
15491549
static const CompileTimeErrorCode DEFAULT_LIST_CONSTRUCTOR =
1550-
CompileTimeErrorCode('DEFAULT_LIST_CONSTRUCTOR',
1551-
"Calling the default 'List' constructor causes an error.",
1550+
CompileTimeErrorCode(
1551+
'DEFAULT_LIST_CONSTRUCTOR',
1552+
"The default 'List' constructor is not available when null safety is "
1553+
"enabled.",
15521554
correction: "Try using a list literal, 'List.filled' or "
15531555
"'List.generate'.");
15541556

pkg/analyzer/tool/diagnostics/diagnostics.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1379,7 +1379,7 @@ class C {
13791379

13801380
### default_list_constructor
13811381

1382-
_Calling the default 'List' constructor causes an error._
1382+
_The default 'List' constructor is not available when null safety is enabled._
13831383

13841384
#### Description
13851385

0 commit comments

Comments
 (0)