Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(195)

Unified Diff: pkg/analyzer/test/src/task/strong/inferred_type_test.dart

Issue 2205993002: fix #26990, incorrect substitution of upper bound (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: sort Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/test/src/summary/resynthesize_ast_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/task/strong/inferred_type_test.dart
diff --git a/pkg/analyzer/test/src/task/strong/inferred_type_test.dart b/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
index feef92f14cf355f0eff9b1a3f41e53ac160d319a..5a4793497dda2646071693ff8527928b827ca7b3 100644
--- a/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
+++ b/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
@@ -588,6 +588,24 @@ class C2 implements A, B {
''');
}
+ void test_constructors_inferenceFBounded() {
+ // Regression for https://github.com/dart-lang/sdk/issues/26990
+ var unit = checkFile('''
+class Clonable<T> {}
+
+class Pair<T extends Clonable<T>, U extends Clonable<U>> {
+ T t;
+ U u;
+ Pair(this.t, this.u);
+ Pair._();
+ Pair<U, T> get reversed => /*info:INFERRED_TYPE_ALLOCATION*/new Pair(u, t);
+}
+final x = /*info:INFERRED_TYPE_ALLOCATION*/new Pair._();
+ ''');
+ var x = unit.topLevelVariables[0];
+ expect(x.type.toString(), 'Pair<Clonable<dynamic>, Clonable<dynamic>>');
+ }
+
void test_constructors_inferFromArguments() {
var unit = checkFile('''
class C<T> {
@@ -734,6 +752,18 @@ main() {
expect(unit.topLevelVariables[0].type.toString(), 'C<int>');
}
+ void test_constructors_reverseTypeParameters() {
+ // Regression for https://github.com/dart-lang/sdk/issues/26990
+ checkFile('''
+class Pair<T, U> {
+ T t;
+ U u;
+ Pair(this.t, this.u);
+ Pair<U, T> get reversed => /*info:INFERRED_TYPE_ALLOCATION*/new Pair(u, t);
+}
+ ''');
+ }
+
void test_doNotInferOverriddenFieldsThatExplicitlySayDynamic_infer() {
checkFile('''
class A {
« no previous file with comments | « pkg/analyzer/test/src/summary/resynthesize_ast_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698