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

Unified Diff: tests/language_2/type_variable_promotion_test.dart

Issue 3008723002: Migrate block 163 to Dart 2.0. (Closed)
Patch Set: Created 3 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
Index: tests/language_2/type_variable_promotion_test.dart
diff --git a/tests/language_strong/type_variable_promotion_test.dart b/tests/language_2/type_variable_promotion_test.dart
similarity index 83%
rename from tests/language_strong/type_variable_promotion_test.dart
rename to tests/language_2/type_variable_promotion_test.dart
index 6be5df7dcecac24fb547082fe69bed52c5c9371d..db4715dc7932ebae55c1971791e9880b53c7dcd7 100644
--- a/tests/language_strong/type_variable_promotion_test.dart
+++ b/tests/language_2/type_variable_promotion_test.dart
@@ -9,12 +9,12 @@ class A {}
class B extends A {}
class Foo<T extends A> {
- String foo(T x) {
+ dynamic foo(T x) {
if (x is B) {
var list = [x];
Lasse Reichstein Nielsen 2017/08/29 08:49:44 What is this testing? The name suggests promotion,
jcollins 2017/08/29 17:39:10 Nope, you're not missing anything. With fresher e
- return list.runtimeType.toString();
+ return list;
}
- return '';
+ return null;
}
List<T> bar(T x) {
@@ -30,6 +30,6 @@ class Foo<T extends A> {
main() {
var foo = new Foo<B>();
var b = new B();
- Expect.equals(foo.foo(b), 'List<B>');
+ Expect.isTrue(foo.foo(b) is List<B>);
Expect.listEquals(foo.bar(b), [b]);
Lasse Reichstein Nielsen 2017/08/29 08:49:44 listEquals only checks length and content, so it's
jcollins 2017/08/29 17:39:10 Yes. I think it's probably written this way to be
}

Powered by Google App Engine
This is Rietveld 408576698