mirror of
https://github.com/dart-lang/sdk
synced 2024-11-02 08:44:27 +00:00
[CMSR] Test that it works with FunctionTypedFormalParameter(s).
Change-Id: I86d483d379e7fe0be2dccf1659d2c6377dcc8eb1 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311140 Reviewed-by: Samuel Rawlins <srawlins@google.com> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
This commit is contained in:
parent
ecc18c9600
commit
98d7e25027
1 changed files with 32 additions and 0 deletions
|
@ -1967,6 +1967,38 @@ ChangeStatusFailure
|
|||
''');
|
||||
}
|
||||
|
||||
Future<void> test_topFunction_functionTypedFormalParameter() async {
|
||||
await _analyzeValidSelection(r'''
|
||||
void ^test(int a()) {}
|
||||
|
||||
void f() {
|
||||
test(() => 0);
|
||||
}
|
||||
''');
|
||||
|
||||
final signatureUpdate = MethodSignatureUpdate(
|
||||
formalParameters: [
|
||||
FormalParameterUpdate(
|
||||
id: 0,
|
||||
kind: FormalParameterKind.requiredNamed,
|
||||
),
|
||||
],
|
||||
formalParametersTrailingComma: TrailingComma.always,
|
||||
argumentsTrailingComma: ArgumentsTrailingComma.ifPresent,
|
||||
);
|
||||
|
||||
await _assertUpdate(signatureUpdate, r'''
|
||||
>>>>>>> /home/test/lib/test.dart
|
||||
void test({
|
||||
required int a(),
|
||||
}) {}
|
||||
|
||||
void f() {
|
||||
test(a: () => 0);
|
||||
}
|
||||
''');
|
||||
}
|
||||
|
||||
Future<void> test_topFunction_multipleFiles() async {
|
||||
newFile('$testPackageLibPath/a.dart', r'''
|
||||
import 'test.dart';
|
||||
|
|
Loading…
Reference in a new issue