| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 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. |
| 4 |
| 5 // Test for F-Bounded Quantification. |
| 6 |
| 7 import "package:expect/expect.dart"; |
| 8 |
| 9 class A<T extends B<T>> { |
| 10 } |
| 11 |
| 12 class B<T extends A<T>> { |
| 13 } |
| 14 |
| 15 isCheckedMode() { |
| 16 try { |
| 17 var i = 1; |
| 18 String s = i; |
| 19 return false; |
| 20 } catch (e) { |
| 21 return true; |
| 22 } |
| 23 } |
| 24 |
| 25 main() { |
| 26 bool got_type_error = false; |
| 27 try { |
| 28 Expect.equals("A<B<int>>", new A<B<int>>().runtimeType.toString()); |
| 29 } on TypeError catch (error) { |
| 30 got_type_error = true; |
| 31 } |
| 32 // Type error expected in checked mode only. |
| 33 Expect.isTrue(got_type_error == isCheckedMode()); |
| 34 } |
| 35 |
| OLD | NEW |