Unify two error codes from the perspective of documentation

Change-Id: I53586ba07d3980045a9d869ce33100fcf7c4c604
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130280
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
This commit is contained in:
Brian Wilkerson 2020-01-05 20:59:27 +00:00 committed by commit-bot@chromium.org
parent fbadd6a832
commit 5323d60b97
2 changed files with 5 additions and 15 deletions

View file

@ -5003,12 +5003,6 @@ class CompileTimeErrorCode extends AnalyzerErrorCode {
isUnresolvedIdentifier: true);
/**
* 7.6.1 Generative Constructors: Let <i>C</i> be the class in which the
* superinitializer appears and let <i>S</i> be the superclass of <i>C</i>.
* Let <i>k</i> be a generative constructor. It is a compile-time error if
* class <i>S</i> does not declare a generative constructor named <i>S</i>
* (respectively <i>S.id</i>)
*
* Parameters:
* 0: the name of the superclass that does not define the invoked constructor
* 1: the name of the constructor being invoked
@ -5020,17 +5014,13 @@ class CompileTimeErrorCode extends AnalyzerErrorCode {
"invoking a different constructor.");
/**
* 7.6.1 Generative Constructors: Let <i>C</i> be the class in which the
* superinitializer appears and let <i>S</i> be the superclass of <i>C</i>.
* Let <i>k</i> be a generative constructor. It is a compile-time error if
* class <i>S</i> does not declare a generative constructor named <i>S</i>
* (respectively <i>S.id</i>)
*
* Parameters:
* 0: the name of the superclass that does not define the invoked constructor
*/
static const CompileTimeErrorCode
UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT = CompileTimeErrorCode(
UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT =
CompileTimeErrorCodeWithUniqueName(
'UNDEFINED_CONSTRUCTOR_IN_INITIALIZER',
'UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT',
"The class '{0}' doesn't have an unnamed constructor.",
correction: "Try defining an unnamed constructor in '{0}', or "

View file

@ -49,11 +49,11 @@ class D extends C {}
class D2 extends C {
D2();
//^^
// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT
// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER
// [cfe] The superclass, 'C', has no unnamed constructor that takes no arguments.
D2.named() : this.x = 499;
//^^
// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT
// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER
// [cfe] The superclass, 'C', has no unnamed constructor that takes no arguments.
var x;
}