Index: test/codegen/corelib/from_environment_const_type_undefined_test.dart |
diff --git a/test/codegen/corelib/from_environment_const_type_undefined_test.dart b/test/codegen/corelib/from_environment_const_type_undefined_test.dart |
new file mode 100644 |
index 0000000000000000000000000000000000000000..dd89c831173fc22c5783c4328db9cde771b7b44a |
--- /dev/null |
+++ b/test/codegen/corelib/from_environment_const_type_undefined_test.dart |
@@ -0,0 +1,42 @@ |
+// 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 "package:expect/expect.dart"; |
+ |
+class Foo {} |
+ |
+const |
+ bool /// 01: ok |
+ int /// 02: static type warning, checked mode compile-time error |
+ String /// 03: static type warning, checked mode compile-time error |
+ Foo /// 04: static type warning, checked mode compile-time error |
+ a = const bool.fromEnvironment('a'); |
+ |
+const |
+ bool /// 05: ok |
+ int /// 06: static type warning, checked mode compile-time error |
+ String /// 07: static type warning, checked mode compile-time error |
+ Foo /// 08: static type warning, checked mode compile-time error |
+ b = const bool.fromEnvironment('b'); |
+ |
+const |
+ bool /// 09: static type warning |
+ int /// 10: ok |
+ String /// 11: static type warning |
+ Foo /// 12: static type warning |
+ c = const int.fromEnvironment('c'); |
+ |
+const |
+ bool /// 13: static type warning |
+ int /// 14: static type warning |
+ String /// 15: ok |
+ Foo /// 16: static type warning |
+ d = const String.fromEnvironment('d'); |
+ |
+main() { |
+ Expect.equals(a, false); |
+ Expect.equals(b, false); |
+ Expect.equals(c, null); |
+ Expect.equals(d, null); |
+} |