Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(90)

Side by Side Diff: tests/language/malformed_inheritance_test.dart

Issue 26888005: Disallow extending a malformed type (issue 13940). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/language/language_dart2js.status ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 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 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 // Tests that malformed types used in extends, implements, and with clauses 5 // Tests that malformed types used in extends, implements, and with clauses
6 // cause compile-time errors. 6 // cause compile-time errors.
7 7
8 import 'package:expect/expect.dart'; 8 import 'package:expect/expect.dart';
9 9
10 class A<T> {} 10 class A<T> {}
11 11
12 class C 12 class C
13 extends Unresolved /// 01: compile-time error 13 extends Unresolved /// 01: compile-time error
14 extends A<Unresolved> /// 02: static type warning 14 extends A<Unresolved> /// 02: static type warning
15 extends Object with Unresolved /// 03: compile-time error 15 extends Object with Unresolved /// 03: compile-time error
16 extends Object with A<Unresolved> /// 04: static type warning 16 extends Object with A<Unresolved> /// 04: static type warning
17 implements Unresolved /// 05: compile-time error 17 implements Unresolved /// 05: compile-time error
18 implements A<Unresolved> /// 06: static type warning 18 implements A<Unresolved> /// 06: static type warning
19 <A> extends A<int> /// 07: compile-time error
20 <A> extends A<Unresolved> /// 08: compile-time error
21 <A> extends Object with A<int> /// 09: compile-time error
22 <A> extends Object with A<Unresolved> /// 10: compile-time error
23 <A> implements A<int> /// 11: compile-time error
24 <A> implements A<Unresolved> /// 12: compile-time error
19 { 25 {
20 26
21 } 27 }
22 28
23 void main() { 29 void main() {
24 new C(); 30 new C();
25 Expect.isTrue(new C() is A<String> && new C() is A<int>); /// 02: continued 31 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 32 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 33 Expect.isTrue(new C() is A<String> && new C() is A<int>); /// 06: continued
28 } 34 }
OLDNEW
« no previous file with comments | « tests/language/language_dart2js.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698