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 // Tests that malformed types used in extends, implements, and with clauses |
| 6 // cause compile-time errors. |
| 7 |
| 8 import 'package:expect/expect.dart'; |
| 9 |
| 10 class A<T> {} |
| 11 |
| 12 class C |
| 13 extends Unresolved /// 01: compile-time error |
| 14 extends A<Unresolved> /// 02: static type warning |
| 15 extends Object with Unresolved /// 03: compile-time error |
| 16 extends Object with A<Unresolved> /// 04: static type warning |
| 17 implements Unresolved /// 05: compile-time error |
| 18 implements A<Unresolved> /// 06: static type warning |
| 19 { |
| 20 |
| 21 } |
| 22 |
| 23 void main() { |
| 24 new C(); |
| 25 Expect.isTrue(new C() is A<String> && new C() is A<int>); /// 02: continued |
| 26 Expect.isTrue(new C() is A<String> && new C() is A<int>); /// 04: continued |
| 27 Expect.isTrue(new C() is A<String> && new C() is A<int>); /// 06: continued |
| 28 } |
OLD | NEW |