| Index: pkg/analyzer/test/src/task/strong/checker_test.dart
|
| diff --git a/pkg/analyzer/test/src/task/strong/checker_test.dart b/pkg/analyzer/test/src/task/strong/checker_test.dart
|
| index cff878253e8a335a4850fdd2bbcebb6b14bde2e4..6ddbcafc7c03a3f7a56aea9e2d4165d8eaa42d3c 100644
|
| --- a/pkg/analyzer/test/src/task/strong/checker_test.dart
|
| +++ b/pkg/analyzer/test/src/task/strong/checker_test.dart
|
| @@ -737,7 +737,47 @@ void main() {
|
| test('dynamic functions - closures are not fuzzy', () {
|
| // Regression test for
|
| // https://github.com/dart-lang/sdk/issues/26118
|
| + // https://github.com/dart-lang/sdk/issues/26156
|
| checkFile('''
|
| + void takesF(void f(int x)) {}
|
| +
|
| + typedef void TakesInt(int x);
|
| +
|
| + void update(_) {}
|
| + void updateOpt([_]) {}
|
| + void updateOptNum([num x]) {}
|
| +
|
| + class A {
|
| + TakesInt f;
|
| + A(TakesInt g) {
|
| + f = update;
|
| + f = updateOpt;
|
| + f = updateOptNum;
|
| + }
|
| + TakesInt g(bool a, bool b) {
|
| + if (a) {
|
| + return update;
|
| + } else if (b) {
|
| + return updateOpt;
|
| + } else {
|
| + return updateOptNum;
|
| + }
|
| + }
|
| + }
|
| +
|
| + void test0() {
|
| + takesF(update);
|
| + takesF(updateOpt);
|
| + takesF(updateOptNum);
|
| + TakesInt f;
|
| + f = update;
|
| + f = updateOpt;
|
| + f = updateOptNum;
|
| + new A(update);
|
| + new A(updateOpt);
|
| + new A(updateOptNum);
|
| + }
|
| +
|
| void test1() {
|
| void takesF(f(int x)) => null;
|
| takesF((dynamic y) => 3);
|
|
|