| 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 import 'dart:mirrors'; |
| 7 | 8 |
| 8 import "deferred_constraints_constants_lib.dart" deferred as lib; | 9 import "deferred_constraints_constants_lib.dart" deferred as lib; |
| 9 | 10 |
| 10 const myConst1 = | 11 const myConst1 = |
| 11 lib.constantInstance; /// reference1: compile-time error | 12 lib.constantInstance; /// reference1: compile-time error |
| 12 /* /// reference1: continued | 13 /* /// reference1: continued |
| 13 499; | 14 499; |
| 14 */ /// reference1: continued | 15 */ /// reference1: continued |
| 15 const myConst2 = | 16 const myConst2 = |
| 16 lib.Const.instance; /// reference2: compile-time error | 17 lib.Const.instance; /// reference2: compile-time error |
| (...skipping 30 matching lines...) Expand all Loading... |
| 47 lib.loadLibrary().then((_) { | 48 lib.loadLibrary().then((_) { |
| 48 var instance = lib.constantInstance; | 49 var instance = lib.constantInstance; |
| 49 var c1 = const lib.Const(); /// constructor1: compile-time error | 50 var c1 = const lib.Const(); /// constructor1: compile-time error |
| 50 var c2 = const lib.Const.namedConstructor(); /// constructor2: compile-time
error | 51 var c2 = const lib.Const.namedConstructor(); /// constructor2: compile-time
error |
| 51 f1(); | 52 f1(); |
| 52 f2(); | 53 f2(); |
| 53 var constInstance = lib.constantInstance; /// reference_after_load: ok | 54 var constInstance = lib.constantInstance; /// reference_after_load: ok |
| 54 var h1 = new H1(); | 55 var h1 = new H1(); |
| 55 var h2 = new H2(); | 56 var h2 = new H2(); |
| 56 var h3 = new H3(); | 57 var h3 = new H3(); |
| 58 |
| 59 // Need to access the metadata to trigger the expected compilation error. |
| 60 reflectClass(H1).metadata; // metadata1: continued |
| 61 reflectClass(H2).metadata; // metadata2: continued |
| 62 reflectClass(H3).metadata; // metadata3: continued |
| 63 |
| 57 asyncEnd(); | 64 asyncEnd(); |
| 58 }); | 65 }); |
| 59 } | 66 } |
| 60 | 67 |
| OLD | NEW |