Chromium Code Reviews| Index: sdk/lib/_internal/compiler/implementation/warnings.dart |
| diff --git a/sdk/lib/_internal/compiler/implementation/warnings.dart b/sdk/lib/_internal/compiler/implementation/warnings.dart |
| index 5a8ae00f3f5ed7358b3866a95dc3160e00bbf8ed..3f60bd31abb44bcfacf6aeb83ec0afc67d359c29 100644 |
| --- a/sdk/lib/_internal/compiler/implementation/warnings.dart |
| +++ b/sdk/lib/_internal/compiler/implementation/warnings.dart |
| @@ -418,6 +418,37 @@ main() => new C(0);"""]); |
| static const MessageKind CANNOT_INSTANTIATE_TYPEDEF = const MessageKind( |
| 'Error: Cannot instantiate typedef "#{typedefName}".'); |
| + static const MessageKind REQUIRED_PARAMETER_WITH_DEFAULT = const MessageKind( |
| + "Error: Non-optional parameters can't have default a value.", |
| + howToFix: "Remove the default value or make the parameter optional.", |
|
ahe
2013/09/13 07:17:05
"Remove ..." sound like a command/order, could you
|
| + examples: const [""" |
| +main() { |
| + foo(a: 1) => print(a); |
| + foo(2); |
| +}""", """ |
| +main() { |
| + foo(a = 1) => print(a); |
| + foo(2); |
| +}"""]); |
| + |
| + static const MessageKind NAMED_PARAMETER_WITH_EQUALS = const MessageKind( |
| + "Error: Named parameters must use ':'.", |
|
ahe
2013/09/13 07:17:05
I have a suspicion that Luke would say this error
|
| + howToFix: "Change '=' to ':'", |
|
ahe
2013/09/13 07:17:05
Suggestion?
|
| + examples: const [""" |
| +main() { |
| + foo({a = 1}) => print(a); |
| + foo(a: 2); |
| +}"""]); |
| + |
| + static const MessageKind POSITIONAL_PARAMETER_WITH_EQUALS = const MessageKind( |
| + "Error: Positional optional parameters must use '='.", |
|
ahe
2013/09/13 07:17:05
Possibly rude, see above.
|
| + howToFix: "Change ':' to '='", |
|
ahe
2013/09/13 07:17:05
Suggestion?
|
| + examples: const [""" |
| +main() { |
| + foo([a: 1]) => print(a); |
| + foo(2); |
| +}"""]); |
| + |
| static const MessageKind TYPEDEF_FORMAL_WITH_DEFAULT = const MessageKind( |
| "Error: A parameter of a typedef can't specify a default value.", |
| howToFix: "Remove the default value.", |