Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // BSD-style license that can be found in the LICENSE file. | |
| 4 | |
| 5 import "dart:async"; | |
| 6 | |
| 7 @lazy import "deferred_constraints_lib.dart" as lib; | |
| 8 import "deferred_constraints_lib.dart" as lib2; /// type_annotation_non_deferred : ok | |
| 9 | |
| 10 const lazy = const DeferredLibrary('lib'); | |
| 11 | |
| 12 class F {} | |
| 13 class G2<T> {} | |
| 14 | |
| 15 void main() { | |
| 16 lib.C a = new lib.C(); /// type_annotation1: runtime error, static type warnin g | |
|
floitsch
2014/02/28 12:58:15
these long names make it harder to review, because
sigurdm
2014/03/03 13:18:49
On the other hand the status files and test run me
| |
| 17 lib.C a = null; /// type_annotation_null: static type warning | |
| 18 | |
| 19 // In this case we do not defer C. | |
| 20 lib2.C a = new lib.C(); /// type_annotation_non_deferred: continued | |
|
floitsch
2014/02/28 12:58:15
new lib2.C()?
sigurdm
2014/03/03 13:18:49
Done.
| |
| 21 lazy.load().then((_) { | |
| 22 lib.C a = new lib.C(); /// type_annotation2: dynamic type error, static type warning | |
|
floitsch
2014/02/28 12:58:15
don't declare "a", "g" several times.
sigurdm
2014/03/03 13:18:49
Done.
| |
| 23 lib.G<F> a = new lib.G<F>(); /// type_annotation_generic1: dynamic type erro r, static type warning | |
| 24 G2<lib.C> a = new G2(); /// type_annotation_generic2: static type warning | |
| 25 G2<lib.C> a = new G2<lib.C>(); /// type_annotation_generic3: static type war ning | |
| 26 lib.G<lib.C> a = new lib.G<lib.C>(); /// type_annotation_generic4: dynamic t ype error, static type warning | |
| 27 var a = new lib.C(); /// new: ok | |
| 28 var g = new lib.G<F>(); /// new_generic1: ok | |
| 29 var g = new G2<lib.C>(); /// new_generic2: static type warning | |
|
floitsch
2014/02/28 12:58:15
why is this not a dynamic error?
sigurdm
2014/03/03 13:18:49
That also confused me.
The type arguments of the c
| |
| 30 var g = new lib.G<lib.C>(); /// new_generic3: static type warning | |
| 31 var instance = lib.constantInstance; | |
| 32 bool a = instance is lib.Const; /// is_check: runtime error, static type war ning | |
| 33 instance as lib.Const; /// as_operation: runtime error, static type warning | |
| 34 try { throw inst; } on lib.C {} /// catch_check: runtime error, static type warning | |
| 35 }); | |
| 36 } | |
| 37 | |
| 38 lib.C a = null; /// type_annotation_top_level: static type warning | |
| OLD | NEW |