Skip to content

Commit bb702d4

Browse files
pqCommit Queue
authored and
Commit Queue
committed
augmentation test for prefer_generic_function_type_aliases
See: https://github.com/dart-lang/linter/issues/4942 If I'm reading the spec right, this should be legal but is just not yet supported by the parser. Change-Id: I793cf237683c296c6db49cc9ba614a945433da06 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363622 Commit-Queue: Phil Quitslund <[email protected]> Reviewed-by: Konstantin Shcheglov <[email protected]>
1 parent e90210b commit bb702d4

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

pkg/linter/test/rules/prefer_generic_function_type_aliases_test.dart

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,24 @@ class PreferGenericFunctionTypeAliasesTest extends LintRuleTest {
1717
@override
1818
String get lintRule => 'prefer_generic_function_type_aliases';
1919

20+
@FailingTest(reason: '''
21+
ParserErrorCode.EXTRANEOUS_MODIFIER [27, 7, Can't have modifier 'augment' here.]
22+
CompileTimeErrorCode.DUPLICATE_DEFINITION [48, 1, The name 'F' is already defined.]
23+
''', issue: 'https://github.com/dart-lang/linter/issues/4942')
24+
test_augmentedTypeAlias() async {
25+
newFile('$testPackageLibPath/a.dart', r'''
26+
import augment 'test.dart';
27+
28+
typedef void F();
29+
''');
30+
31+
await assertNoDiagnostics(r'''
32+
augment library 'a.dart';
33+
34+
augment typedef void F();
35+
''');
36+
}
37+
2038
test_classicTypedef() async {
2139
await assertDiagnostics(r'''
2240
typedef void F();

0 commit comments

Comments
 (0)