Skip to content

Commit ae5d497

Browse files
bwilkersoncommit-bot@chromium.org
authored andcommitted
Improve a diagnostic message by adding specific type information
Also, re-enable some tests that were unintentionally commented out. Change-Id: I88ee5cf690c6c7132d80becae6952add229eba47 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/109983 Reviewed-by: Phil Quitslund <[email protected]> Reviewed-by: Konstantin Shcheglov <[email protected]> Commit-Queue: Brian Wilkerson <[email protected]>
1 parent 3605630 commit ae5d497

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1237,13 +1237,15 @@ class CompileTimeErrorCode extends ErrorCode {
12371237
correction: "Try using just the name of the extension.");
12381238

12391239
/**
1240-
* No parameters.
1240+
* Parameters:
1241+
* 0: the type of the argument
1242+
* 1: the extended type
12411243
*/
12421244
static const CompileTimeErrorCode EXTENSION_OVERRIDE_ARGUMENT_NOT_ASSIGNABLE =
12431245
const CompileTimeErrorCode(
12441246
'EXTENSION_OVERRIDE_ARGUMENT_NOT_ASSIGNABLE',
1245-
"The argument to the extension override is not assignable to the "
1246-
"extended type.");
1247+
"The type of the argument to the extension override '{0}' "
1248+
"is not assignable to the extended type '{1}'.");
12471249

12481250
/**
12491251
* 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m &lt;

pkg/analyzer/test/src/diagnostics/extension_override_argument_not_assignable_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import '../dart/resolution/driver_resolution.dart';
1111

1212
main() {
1313
defineReflectiveSuite(() {
14-
// defineReflectiveTests(ExtensionDeclaresAbstractMethodTest);
14+
defineReflectiveTests(ExtensionDeclaresAbstractMethodTest);
1515
defineReflectiveTests(ExtensionDeclaresAbstractMethodWithNNBDTest);
1616
});
1717
}

0 commit comments

Comments
 (0)