| OLD | NEW |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 // Test that if the type of a parameter of a generic method is a type parameter, | 5 // Test that if the type of a parameter of a generic method is a type parameter, |
| 6 // the type of the passed argument is checked (01) at compile time | 6 // the type of the passed argument is checked (01) at compile time |
| 7 // if the receiver is given via an interface-type variable, and (02) at runtime | 7 // if the receiver is given via an interface-type variable, and (02) at runtime |
| 8 // if the receiver is dynamic. | 8 // if the receiver is dynamic. |
| 9 | 9 |
| 10 library generic_methods_dynamic_test; | 10 library generic_methods_dynamic_test; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 Expect.equals(obj.foo<B>(b), b); //# 05: continued | 35 Expect.equals(obj.foo<B>(b), b); //# 05: continued |
| 36 | 36 |
| 37 dynamic x = c.bar<B>(<B>[new B()]); //# 05: continued | 37 dynamic x = c.bar<B>(<B>[new B()]); //# 05: continued |
| 38 Expect.isTrue(x is List<B>); //# 05: continued | 38 Expect.isTrue(x is List<B>); //# 05: continued |
| 39 Expect.equals(x.length, 1); //# 05: continued | 39 Expect.equals(x.length, 1); //# 05: continued |
| 40 | 40 |
| 41 dynamic y = obj.bar<B>(<B>[new B()]); //# 05: continued | 41 dynamic y = obj.bar<B>(<B>[new B()]); //# 05: continued |
| 42 Expect.isTrue(y is List<B>); //# 05: continued | 42 Expect.isTrue(y is List<B>); //# 05: continued |
| 43 Expect.equals(y.length, 1); //# 05: continued | 43 Expect.equals(y.length, 1); //# 05: continued |
| 44 } | 44 } |
| OLD | NEW |