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 import 'package:expect/expect.dart'; | 5 import 'package:expect/expect.dart'; |
6 import 'package:async_helper/async_helper.dart'; | 6 import 'package:async_helper/async_helper.dart'; |
7 | 7 |
8 import "deferred_constraints_lib.dart" deferred as lib; | 8 import "deferred_constraints_lib.dart" deferred as lib; |
9 import "deferred_constraints_lib.dart" as lib2; /// type_annotation_non_deferred
: ok | 9 import "deferred_constraints_lib.dart" as lib2; /// type_annotation_non_deferred
: ok |
10 | 10 |
11 class F {} | 11 class F {} |
12 class G2<T> {} | 12 class G2<T> {} |
13 | 13 |
14 main() { | 14 main() { |
15 lib.C a = null; /// type_annotation_null: static type warning | 15 lib.C a = null; /// type_annotation_null: static type warning |
16 Expect.throws(() { /// new_before_load: static type warning | 16 Expect.throws(() { /// new_before_load: static type warning |
17 lib.C a = new lib.C(); /// new_before_load: continued | 17 lib.C a = new lib.C(); /// new_before_load: continued |
18 }, (e) => e is NoSuchMethodError); /// new_before_load: continued | 18 }, (e) => e is Error); /// new_before_load: continued |
19 | 19 |
20 // In this case we do not defer C. | 20 // In this case we do not defer C. |
21 lib2.C a1 = new lib2.C(); /// type_annotation_non_deferred: continued | 21 lib2.C a1 = new lib2.C(); /// type_annotation_non_deferred: continued |
22 asyncStart(); | 22 asyncStart(); |
23 lib.loadLibrary().then((_) { | 23 lib.loadLibrary().then((_) { |
24 lib.C a2 = new lib.C(); /// type_annotation1: dynamic type error, static typ
e warning | 24 lib.C a2 = new lib.C(); /// type_annotation1: dynamic type error, static typ
e warning |
25 lib.G<F> a3 = new lib.G<F>(); /// type_annotation_generic1: dynamic type err
or, static type warning | 25 lib.G<F> a3 = new lib.G<F>(); /// type_annotation_generic1: dynamic type err
or, static type warning |
26 G2<lib.C> a4 = new G2(); /// type_annotation_generic2: static type warning | 26 G2<lib.C> a4 = new G2(); /// type_annotation_generic2: static type warning |
27 G2<lib.C> a5 = new G2<lib.C>(); /// type_annotation_generic3: static type wa
rning | 27 G2<lib.C> a5 = new G2<lib.C>(); /// type_annotation_generic3: static type wa
rning |
28 lib.G<lib.C> a = new lib.G<lib.C>(); /// type_annotation_generic4: dynamic t
ype error, static type warning | 28 lib.G<lib.C> a = new lib.G<lib.C>(); /// type_annotation_generic4: dynamic t
ype error, static type warning |
(...skipping 12 matching lines...) Expand all Loading... |
41 }, (e) => e is TypeError); /// as_operation: continued | 41 }, (e) => e is TypeError); /// as_operation: continued |
42 Expect.throws(() { /// catch_check: static type warning | 42 Expect.throws(() { /// catch_check: static type warning |
43 try { throw instance; } on lib.Const {} /// catch_check: continued | 43 try { throw instance; } on lib.Const {} /// catch_check: continued |
44 }, (e) => e is TypeError); /// catch_check: continued | 44 }, (e) => e is TypeError); /// catch_check: continued |
45 int i = lib.C.staticMethod(); /// static_method: ok | 45 int i = lib.C.staticMethod(); /// static_method: ok |
46 asyncEnd(); | 46 asyncEnd(); |
47 }); | 47 }); |
48 } | 48 } |
49 | 49 |
50 lib.C a9 = null; /// type_annotation_top_level: static type warning | 50 lib.C a9 = null; /// type_annotation_top_level: static type warning |
OLD | NEW |