Skip to content

Commit

Permalink
Add diagnostic docs for extension types
Browse files Browse the repository at this point in the history
I'm fairly sure there will be other diagnostics added later, so this
isn't everything, but it covers the diagnostics that are currently
implemented in the analyzer.

Change-Id: I27100c9a76e6db4fb2b0bf8b9bc6b0b2c326707f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/322442
Reviewed-by: Marya Belanger <mbelanger@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
  • Loading branch information
bwilkerson authored and Commit Queue committed Nov 28, 2023
1 parent 2bc46e9 commit d91f3a1
Show file tree
Hide file tree
Showing 4 changed files with 1,039 additions and 8 deletions.
8 changes: 5 additions & 3 deletions pkg/analyzer/lib/src/error/codes.g.dart
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,9 @@ class CompileTimeErrorCode extends AnalyzerErrorCode {
'AWAIT_OF_EXTENSION_TYPE_NOT_FUTURE',
"The 'await' expression can't be used for an expression with an extension "
"type that is not a subtype of 'Future'.",
correctionMessage: "Try updating the extension type to implement 'Future'.",
correctionMessage:
"Try removing the `await`, or updating the extension type to implement "
"'Future'.",
);

/// Parameters:
Expand Down Expand Up @@ -1672,8 +1674,8 @@ class CompileTimeErrorCode extends AnalyzerErrorCode {
static const CompileTimeErrorCode
EXTENSION_TYPE_CONSTRUCTOR_WITH_SUPER_INVOCATION = CompileTimeErrorCode(
'EXTENSION_TYPE_CONSTRUCTOR_WITH_SUPER_INVOCATION',
"Extension type constructors can't include superinitializers.",
correctionMessage: "Try removing the superconstructor invocation.",
"Extension type constructors can't include super initializers.",
correctionMessage: "Try removing the super constructor invocation.",
);

/// No parameters.
Expand Down
Loading

0 comments on commit d91f3a1

Please sign in to comment.