Migration: add repro for #44012

Bug: https://github.com/dart-lang/sdk/issues/44012
Change-Id: Iabddb6de213aa70feb42b273f0e48fc2b5fa582d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170020
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
This commit is contained in:
Paul Berry 2020-11-02 14:43:29 +00:00 committed by commit-bot@chromium.org
parent 4054a9edf4
commit 531ffd0e45
2 changed files with 30 additions and 0 deletions

View file

@ -177,6 +177,12 @@ environment:
"packageUri": "lib/",
"languageVersion": "2.9"
},
{
"name": "http",
"rootUri": "${toUriStr('/.pub-cache/http')}",
"packageUri": "lib/",
"languageVersion": "2.9"
},
{
"name": "meta",
"rootUri": "${toUriStr('/.pub-cache/meta')}",

View file

@ -7347,6 +7347,30 @@ _f(Object x) {
await _checkSingleFileChanges(content, expected);
}
@FailingTest(issue: 'https://github.com/dart-lang/sdk/issues/44012')
Future<void> test_use_import_prefix_when_adding_re_exported_type() async {
addPackageFile('http', 'http.dart', '''
export 'src/base_client.dart';
export 'src/client.dart';
''');
addPackageFile('http', 'src/base_client.dart', '''
import 'client.dart';
abstract class BaseClient implements Client {}
''');
addPackageFile('http', 'src/client.dart', '''
abstract class Client {}
''');
var content = '''
import 'package:http/http.dart' as http;
http.BaseClient downcast(http.Client x) => x;
''';
var expected = '''
import 'package:http/http.dart' as http;
http.BaseClient downcast(http.Client x) => x as http.BaseClient;
''';
await _checkSingleFileChanges(content, expected);
}
Future<void> test_weak_if_visit_weak_subexpression() async {
var content = '''
int f(int x, int/*?*/ y) {