mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 03:47:13 +00:00
Remove reporting duplicate CompileTimeErrorCode.CONST_NOT_INITIALIZED from ConstructorFieldsVerifier.
R=brianwilkerson@google.com Change-Id: I1566c0d4f955846671823fd3736f71f08281d5c5 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129705 Commit-Queue: Konstantin Shcheglov <scheglov@google.com> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This commit is contained in:
parent
37b78b601d
commit
0c7048be74
|
@ -85,20 +85,6 @@ class ConstructorFieldsVerifier {
|
|||
}
|
||||
});
|
||||
|
||||
// Visit all of the states in the map to ensure that none were never
|
||||
// initialized.
|
||||
fieldMap.forEach((FieldElement fieldElement, _InitState state) {
|
||||
if (state == _InitState.notInit) {
|
||||
if (fieldElement.isConst) {
|
||||
_errorReporter.reportErrorForNode(
|
||||
CompileTimeErrorCode.CONST_NOT_INITIALIZED,
|
||||
node.returnType,
|
||||
[fieldElement.name],
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
_reportNotInitializedFinal(node, notInitFinalFields);
|
||||
_reportNotInitializedNonNullable(node, notInitNonNullableFields);
|
||||
}
|
||||
|
|
|
@ -79,7 +79,6 @@ class C extends B {
|
|||
''');
|
||||
assertTestErrorsWithCodes([
|
||||
CompileTimeErrorCode.CONST_NOT_INITIALIZED,
|
||||
CompileTimeErrorCode.CONST_NOT_INITIALIZED,
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
|
@ -9,8 +9,6 @@ class A {
|
|||
|
||||
class B {
|
||||
const B() : n = 5;
|
||||
// ^
|
||||
// [analyzer] COMPILE_TIME_ERROR.CONST_NOT_INITIALIZED
|
||||
final n;
|
||||
static const a;
|
||||
// ^
|
||||
|
|
Loading…
Reference in a new issue