Chromium Code Reviews| Index: pkg/compiler/lib/src/diagnostics/messages.dart |
| diff --git a/pkg/compiler/lib/src/diagnostics/messages.dart b/pkg/compiler/lib/src/diagnostics/messages.dart |
| index 6424772cfe7aabfff580b8a65835ba917077deb6..53b32a849323eefad77b43ae80b64b40a4c79b38 100644 |
| --- a/pkg/compiler/lib/src/diagnostics/messages.dart |
| +++ b/pkg/compiler/lib/src/diagnostics/messages.dart |
| @@ -155,6 +155,7 @@ enum MessageKind { |
| FORIN_NOT_ASSIGNABLE, |
| FORMAL_DECLARED_CONST, |
| FORMAL_DECLARED_STATIC, |
| + FROM_ENVIRONMENT_MUST_BE_CONST, |
| FUNCTION_TYPE_FORMAL_WITH_DEFAULT, |
| FUNCTION_WITH_INITIALIZER, |
| GENERIC, |
| @@ -1078,6 +1079,15 @@ main() => new C(0);""" |
| "This const constructor is not allowed due to " |
| "non-final fields."), |
| + MessageKind.FROM_ENVIRONMENT_MUST_BE_CONST: const MessageTemplate( |
| + MessageKind.FROM_ENVIRONMENT_MUST_BE_CONST, |
| + "#{className}.fromEnvironment can only be used as a " |
| + "const constructor.", |
| + howToFix: "Try replacing `new` with `const`.", |
| + examples: const [ |
| + "abstract class A {} main() { new bool.fromEnvironment('X'); }" |
|
Bob Nystrom
2017/05/24 19:52:09
What's the "abstract class A {}" part for?
Siggi Cherem (dart-lang)
2017/05/24 20:37:19
Thanks for catching that, I copied code form a dif
|
| + ]), |
| + |
| MessageKind.INITIALIZING_FORMAL_NOT_ALLOWED: const MessageTemplate( |
| MessageKind.INITIALIZING_FORMAL_NOT_ALLOWED, |
| "Initializing formal parameter only allowed in generative " |