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:
Konstantin Shcheglov 2019-12-30 01:24:38 +00:00 committed by commit-bot@chromium.org
parent 37b78b601d
commit 0c7048be74
3 changed files with 0 additions and 17 deletions

View file

@ -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);
}

View file

@ -79,7 +79,6 @@ class C extends B {
''');
assertTestErrorsWithCodes([
CompileTimeErrorCode.CONST_NOT_INITIALIZED,
CompileTimeErrorCode.CONST_NOT_INITIALIZED,
]);
}

View file

@ -9,8 +9,6 @@ class A {
class B {
const B() : n = 5;
// ^
// [analyzer] COMPILE_TIME_ERROR.CONST_NOT_INITIALIZED
final n;
static const a;
// ^