Index: sdk/lib/core/bool.dart |
diff --git a/sdk/lib/core/bool.dart b/sdk/lib/core/bool.dart |
index 3465527d7b067862d7524733b781845dab27326e..6660b76f58dda344090b716748eae77fbd900e9f 100644 |
--- a/sdk/lib/core/bool.dart |
+++ b/sdk/lib/core/bool.dart |
@@ -38,6 +38,12 @@ class bool { |
* |
* const isLoggingOn = (const String.fromEnvironment("logging") == "on"); |
*/ |
+ // The .fromEnvironment() constructors are special in that we do not want |
+ // users to call them using "new". We prohibit that by giving them bodies |
+ // that throw, even though const constructors are not allowed to have bodies. |
+ // Disable those static errors. |
+ //ignore: const_constructor_with_body |
+ //ignore: const_factory |
external const factory bool.fromEnvironment(String name, |
{bool defaultValue: false}); |