quick fix for EXTERNAL_TYPEDEF

See: https://github.com/dart-lang/sdk/issues/55917

Change-Id: I3826969b5f20b2140fb522ab1882e5f2330cab5e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369881
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Phil Quitslund <pquitslund@google.com>
This commit is contained in:
pq 2024-06-06 14:45:58 +00:00 committed by Commit Queue
parent d31d0f9618
commit 3f47c93b8c
3 changed files with 15 additions and 5 deletions

View file

@ -45,8 +45,8 @@
#
# Stats:
# - 42 "needsEvaluation"
# - 341 "needsFix"
# - 410 "hasFix"
# - 340 "needsFix"
# - 411 "hasFix"
# - 516 "noFix"
AnalysisOptionsErrorCode.INCLUDED_FILE_PARSE_ERROR:
@ -2815,9 +2815,7 @@ ParserErrorCode.EXTERNAL_SETTER_WITH_BODY:
notes: |-
Remove the `external` keyword, or remove the body.
ParserErrorCode.EXTERNAL_TYPEDEF:
status: needsFix
notes: |-
Remove the `external` keyword.
status: hasFix
ParserErrorCode.EXTRANEOUS_MODIFIER:
status: hasFix
ParserErrorCode.EXTRANEOUS_MODIFIER_IN_EXTENSION_TYPE:

View file

@ -1388,6 +1388,9 @@ final _builtInNonLintProducers = <ErrorCode, List<ProducerGenerator>>{
ParserErrorCode.EXTERNAL_ENUM: [
RemoveExtraModifier.new,
],
ParserErrorCode.EXTERNAL_TYPEDEF: [
RemoveExtraModifier.new,
],
ParserErrorCode.EXTRANEOUS_MODIFIER: [
RemoveExtraModifier.new,
],

View file

@ -213,6 +213,15 @@ enum E { o }
''');
}
Future<void> test_externalTypedef() async {
await resolveTestCode('''
external typedef T();
''');
await assertHasFix('''
typedef T();
''');
}
Future<void> test_final_constructor() async {
await resolveTestCode('''
class C {