Chromium Code Reviews| 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
|
| } |