Skip to content

Commit

Permalink
[wildcards] ensure overridden signatures preserve wildcards
Browse files Browse the repository at this point in the history
See: #56361

Change-Id: I0d37f8b3e034d123410151d3a82acdee5bc8fe9d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/378566
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
  • Loading branch information
pq authored and Commit Queue committed Aug 2, 2024
1 parent 3b09a49 commit 2ffa9d1
Showing 1 changed file with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import 'package:analyzer/src/test_utilities/package_config_file_builder.dart';
import 'package:analyzer_plugin/protocol/protocol_common.dart' hide Element;
import 'package:analyzer_plugin/src/utilities/change_builder/change_builder_dart.dart'
show DartFileEditBuilderImpl, DartLinkedEditBuilderImpl;
import 'package:analyzer_utilities/test/experiments/experiments.dart';
import 'package:test/test.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';

Expand Down Expand Up @@ -3828,6 +3829,28 @@ class B extends A {
);
}

Future<void> test_method_wildcardParams() async {
createAnalysisOptionsFile(experiments: experimentsForTests);

await _assertWriteOverride(
content: '''
class A {
void m(int _, [int _]) { }
}
class B extends A {
}
''',
nameToOverride: 'm',
expected: '''
@override void m(int _, [int _]) {
// TODO: implement m
}
''',
displayText: 'm(int _, [int _]) { … }',
selection: SourceRange(122, 0),
);
}

Future<void> test_mixin_method_of_interface() async {
await _assertWriteOverride(
content: '''
Expand Down

0 comments on commit 2ffa9d1

Please sign in to comment.