| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 // Regression test for issue 14348. | 5 // Regression test for issue 14348. |
| 6 | 6 |
| 7 class A<T> { | 7 class A<T> { |
| 8 const A(); | 8 const A(); |
| 9 } | 9 } |
| 10 | 10 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 } | 34 } |
| 35 | 35 |
| 36 class F<V> implements E { | 36 class F<V> implements E { |
| 37 final V field; | 37 final V field; |
| 38 | 38 |
| 39 const F(this.field); | 39 const F(this.field); |
| 40 const factory F.redirecting(V field) = G<int>; | 40 const factory F.redirecting(V field) = G<int>; |
| 41 } | 41 } |
| 42 | 42 |
| 43 class G<W> implements F { | 43 class G<W> implements F { |
| 44 final field; | 44 final W field; |
| 45 const G(W this.field); | 45 const G(field) : this.field = field; |
| 46 } | 46 } |
| 47 | 47 |
| 48 main() { | 48 main() { |
| 49 const A<int> a = const B<int>(); | 49 const A<int> a = const B<int>(); |
| 50 | 50 |
| 51 const C c1 = const C(a); /// 01: ok | 51 const C c1 = const C(a); /// 01: ok |
| 52 const C c2 = const C.optional(a); /// 02: ok | 52 const C c2 = const C.optional(a); /// 02: ok |
| 53 const C c3 = const C.named(a: a); /// 03: ok | 53 const C c3 = const C.named(a: a); /// 03: ok |
| 54 const C c4 = const C.untyped(a); /// 04: ok | 54 const C c4 = const C.untyped(a); /// 04: ok |
| 55 const C c5 = const C.subtyped(a); /// 05: ok | 55 const C c5 = const C.subtyped(a); /// 05: ok |
| (...skipping 13 matching lines...) Expand all Loading... |
| 69 const C c15 = const C<double>.subtyped(a); /// 17: static type warning, checke
d mode compile-time error | 69 const C c15 = const C<double>.subtyped(a); /// 17: static type warning, checke
d mode compile-time error |
| 70 const C c15m = const C<double>.redirecting(a); /// 18: static type warning | 70 const C c15m = const C<double>.redirecting(a); /// 18: static type warning |
| 71 | 71 |
| 72 const E e1 = const E.redirecting1(0); /// 19: ok | 72 const E e1 = const E.redirecting1(0); /// 19: ok |
| 73 const E e2 = const E.redirecting1(''); /// 20: checked mode compile-time error | 73 const E e2 = const E.redirecting1(''); /// 20: checked mode compile-time error |
| 74 const E e3 = const E.redirecting2(0); /// 21: ok | 74 const E e3 = const E.redirecting2(0); /// 21: ok |
| 75 const E e4 = const E.redirecting2(''); /// 22: checked mode compile-time error | 75 const E e4 = const E.redirecting2(''); /// 22: checked mode compile-time error |
| 76 const E e5 = const E.redirecting3(0); /// 23: ok | 76 const E e5 = const E.redirecting3(0); /// 23: ok |
| 77 const E e6 = const E.redirecting3(''); /// 24: checked mode compile-time error | 77 const E e6 = const E.redirecting3(''); /// 24: checked mode compile-time error |
| 78 } | 78 } |
| OLD | NEW |