Chromium Code Reviews| Index: tests/language/deferred_constraints_constants_test.dart |
| diff --git a/tests/language/deferred_constraints_constants_test.dart b/tests/language/deferred_constraints_constants_test.dart |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..5f5d436c9d93e9a1fbc0952f43f68b23870590ab |
| --- /dev/null |
| +++ b/tests/language/deferred_constraints_constants_test.dart |
| @@ -0,0 +1,41 @@ |
| +// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| +// for details. All rights reserved. Use of this source code is governed by a |
| +// BSD-style license that can be found in the LICENSE file. |
| + |
| +import "dart:async"; |
| +import 'package:expect/expect.dart'; |
| +import 'package:async_helper/async_helper.dart'; |
| + |
| +@lazy import "deferred_constraints_constants_lib.dart" as lib; |
| + |
| +const lazy = const DeferredLibrary('lib'); |
| + |
| +const myConst1 = lib.constantInstance; /// reference1: compile-time error |
| +const myConst2 = lib.Const.instance; /// reference2: compile-time error |
| + |
| +void f1({a: const lib.Const()}) {} /// default_argument1: compile-time error |
|
floitsch
2014/03/12 16:48:13
Try to reduce the coverage of the "///". If this l
|
| +void f2({a: lib.constantInstance}) {} /// default_argument2: compile-time error |
| + |
| +@lib.Const() class H1 {} /// metadata1: compile-time error |
|
floitsch
2014/03/12 16:48:13
@lib.Const() /// metadata1: compile-time error
cl
|
| +@lib.Const.instance class H2 {} /// metadata2: compile-time error |
| +@lib.Const.namedConstructor() class H3 {} /// metadata3: compile-time error |
| + |
| +void main() { |
| + var a1 = myConst1; /// reference1: continued |
| + var a2 = myConst2; /// reference2: continued |
| + |
| + asyncStart(); |
| + lazy.load().then((_) { |
| + var instance = lib.constantInstance; |
| + var c1 = const lib.Const(); /// constructor1: compile-time error |
| + var c2 = const lib.Const.namedConstructor(); /// constructor2: compile-time error |
| + f1(); /// default_argument1: continued |
| + f2(); /// default_argument2: continued |
| + var constInstance = lib.constantInstance; /// reference_after_load: ok |
| + var h1 = new H1(); /// metadata1: continued |
| + var h2 = new H2(); /// metadata2: continued |
| + var h3 = new H3(); /// metadata3: continued |
| + asyncEnd(); |
| + }); |
| +} |
| + |