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

Side by Side Diff: tests/language/src/TypeVariableBounds2Test.dart

Issue 9649015: Change string used to annotate static type issues to 'static type warning' in multitest (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Merged up to tip Created 8 years, 9 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
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 of parameterized types with invalid bounds. 5 // Test of parameterized types with invalid bounds.
6 6
7 interface I<T extends num> { } 7 interface I<T extends num> { }
8 8
9 interface J<T> { } 9 interface J<T> { }
10 10
11 interface K<T> { } 11 interface K<T> { }
12 12
13 class A<T> implements I<T>, J<T> { 13 class A<T> implements I<T>, J<T> {
14 } 14 }
15 15
16 main() { 16 main() {
17 var a = new A<String>(); 17 var a = new A<String>();
18 18
19 { 19 {
20 I i = a; /// 00: dynamic type error, static type error 20 I i = a; /// 00: dynamic type error, static type warning
21 J j = a; /// 01: static type error 21 J j = a; /// 01: static type warning
22 K k = a; /// 02: dynamic type error, static type error 22 K k = a; /// 02: dynamic type error, static type warning
23 23
24 // In production mode, A<String> is subtype of I, but error in checked mode. 24 // In production mode, A<String> is subtype of I, but error in checked mode.
25 var x = a is I; /// 03: dynamic type error, static type error 25 var x = a is I; /// 03: dynamic type error, static type warning
26 26
27 // In both production and checked modes, A<String> is a subtype of I. 27 // In both production and checked modes, A<String> is a subtype of I.
28 Expect.isTrue(a is J); /// 04: static type error 28 Expect.isTrue(a is J); /// 04: static type warning
29 29
30 // In both production and checked modes, A<String> is not a subtype of K. 30 // In both production and checked modes, A<String> is not a subtype of K.
31 // However, while unsuccessfully trying to prove that A<String> is a K, 31 // However, while unsuccessfully trying to prove that A<String> is a K,
32 // a malformed type is encountered in checked mode, resulting in a dynamic 32 // a malformed type is encountered in checked mode, resulting in a dynamic
33 // type error. 33 // type error.
34 Expect.isTrue(a is !K); /// 05: dynamic type error 34 Expect.isTrue(a is !K); /// 05: dynamic type error
35 } 35 }
36 36
37 a = new A<int>(); 37 a = new A<int>();
38 38
39 { 39 {
40 I i = a; 40 I i = a;
41 J j = a; 41 J j = a;
42 K k = a; /// 06: dynamic type error, static type error 42 K k = a; /// 06: dynamic type error, static type warning
43 43
44 // In both production and checked modes, A<int> is a subtype of I. 44 // In both production and checked modes, A<int> is a subtype of I.
45 Expect.isTrue(a is I); 45 Expect.isTrue(a is I);
46 46
47 // In both production and checked modes, A<int> is a subtype of J. 47 // In both production and checked modes, A<int> is a subtype of J.
48 Expect.isTrue(a is J); 48 Expect.isTrue(a is J);
49 49
50 // In both production and checked modes, A<int> is not a subtype of K. 50 // In both production and checked modes, A<int> is not a subtype of K.
51 Expect.isTrue(a is !K); 51 Expect.isTrue(a is !K);
52 } 52 }
53 } 53 }
OLDNEW
« no previous file with comments | « tests/language/src/StringInterpolationTest.dart ('k') | tests/language/src/TypeVariableBoundsTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698