mirror of
https://github.com/dart-lang/sdk
synced 2024-10-14 15:47:08 +00:00
quick fix for FINAL_CONSTRUCTOR
Change-Id: I9bd7f97eeec41a9efc608bea3911f3443c4d7063 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368682 Auto-Submit: Phil Quitslund <pquitslund@google.com> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Commit-Queue: Brian Wilkerson <brianwilkerson@google.com> Commit-Queue: Phil Quitslund <pquitslund@google.com>
This commit is contained in:
parent
a76936859e
commit
13fb73dfec
|
@ -45,8 +45,8 @@
|
|||
#
|
||||
# Stats:
|
||||
# - 42 "needsEvaluation"
|
||||
# - 355 "needsFix"
|
||||
# - 396 "hasFix"
|
||||
# - 354 "needsFix"
|
||||
# - 397 "hasFix"
|
||||
# - 516 "noFix"
|
||||
|
||||
AnalysisOptionsErrorCode.INCLUDED_FILE_PARSE_ERROR:
|
||||
|
@ -2861,9 +2861,7 @@ ParserErrorCode.FINAL_AND_VAR:
|
|||
notes: |-
|
||||
Remove either `final` or `var`.
|
||||
ParserErrorCode.FINAL_CONSTRUCTOR:
|
||||
status: needsFix
|
||||
notes: |-
|
||||
Remove the `final` keyword.
|
||||
status: hasFix
|
||||
ParserErrorCode.FINAL_ENUM:
|
||||
status: needsFix
|
||||
notes: |-
|
||||
|
|
|
@ -1375,6 +1375,9 @@ final _builtInNonLintProducers = <ErrorCode, List<ProducerGenerator>>{
|
|||
ParserErrorCode.EXTRANEOUS_MODIFIER: [
|
||||
RemoveExtraModifier.new,
|
||||
],
|
||||
ParserErrorCode.FINAL_CONSTRUCTOR: [
|
||||
RemoveExtraModifier.new,
|
||||
],
|
||||
ParserErrorCode.GETTER_WITH_PARAMETERS: [
|
||||
RemoveParametersInGetterDeclaration.new,
|
||||
],
|
||||
|
|
|
@ -164,6 +164,19 @@ f() {
|
|||
''');
|
||||
}
|
||||
|
||||
Future<void> test_final_constructor() async {
|
||||
await resolveTestCode('''
|
||||
class C {
|
||||
final C();
|
||||
}
|
||||
''');
|
||||
await assertHasFix('''
|
||||
class C {
|
||||
C();
|
||||
}
|
||||
''');
|
||||
}
|
||||
|
||||
Future<void> test_invalidAsyncConstructorModifier() async {
|
||||
await resolveTestCode(r'''
|
||||
class A {
|
||||
|
|
Loading…
Reference in a new issue