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

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

Issue 2375373002: fix #27040, promote the upper bound of a type parameter (Closed)
Patch Set: Created 4 years, 3 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/lib/src/generated/type_system.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/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 9013f2121b5871f8a4c578d7762c3a64a3b1ea90..f5eda5c342327a03d4ed20693ed6f799174dcf6f 100644
--- a/pkg/analyzer/test/src/task/strong/checker_test.dart
+++ b/pkg/analyzer/test/src/task/strong/checker_test.dart
@@ -3699,7 +3699,9 @@ g() {
}
void test_typePromotionFromTypeParameter() {
- // Regression test for https://github.com/dart-lang/sdk/issues/26965
+ // Regression test for:
+ // https://github.com/dart-lang/sdk/issues/26965
+ // https://github.com/dart-lang/sdk/issues/27040
checkFile(r'''
void f/*<T>*/(/*=T*/ object) {
if (object is String) print(object.substring(1));
@@ -3714,8 +3716,7 @@ class SubClonable<T> extends Clonable<T> {
}
void h/*<T extends Clonable<T>>*/(/*=T*/ object) {
Leaf 2016/09/30 05:00:04 Test that object is usable as a SubClonable<T> as
Jennifer Messerly 2016/09/30 16:58:03 I think `object.m` is supposed to illustrate that.
Leaf 2016/09/30 17:00:30 Sort of. object.m tests that SubClonable methods
if (/*info:NON_GROUND_TYPE_CHECK_INFO*/object is SubClonable/*<T>*/) {
- // Note we need to cast back to T, because promotion lost that type info.
- print(object.m(object as dynamic/*=T*/));
+ print(object.m(object));
}
}
''');
« no previous file with comments | « pkg/analyzer/lib/src/generated/type_system.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698