Migration: add tests for some implicit coercion corner cases

Bug: https://github.com/dart-lang/sdk/issues/47848
Change-Id: I5d04be8f379e35b70b86437940dd9b04c26e8174
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/222028
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
This commit is contained in:
Paul Berry 2021-12-03 20:11:48 +00:00 committed by Commit Bot
parent e07ff780e2
commit bce700e369

View file

@ -954,6 +954,25 @@ Map<int, String?> Function() f(C<String?> c) => c;
}); });
} }
@FailingTest(issue: 'https://github.com/dart-lang/sdk/issues/47848')
Future<void> test_call_tearoff_futureOr() async {
var content = '''
import 'dart:async';
class C {
void call() {}
}
FutureOr<void Function()> f(C c) => c;
''';
var expected = '''
import 'dart:async';
class C {
void call() {}
}
FutureOr<void Function()> f(C c) => c;
''';
await _checkSingleFileChanges(content, expected);
}
Future<void> test_call_tearoff_inherited() async { Future<void> test_call_tearoff_inherited() async {
var content = ''' var content = '''
class B { class B {
@ -1006,6 +1025,23 @@ Map<int, String?> Function() f(C c) => c;
await _checkSingleFileChanges(content, expected); await _checkSingleFileChanges(content, expected);
} }
@FailingTest(issue: 'https://github.com/dart-lang/sdk/issues/47848')
Future<void> test_call_tearoff_raw_function() async {
var content = '''
class C {
void call() {}
}
Function f(C c) => c;
''';
var expected = '''
class C {
void call() {}
}
Function f(C c) => c;
''';
await _checkSingleFileChanges(content, expected);
}
Future<void> test_catch_simple() async { Future<void> test_catch_simple() async {
var content = ''' var content = '''
void f() { void f() {