Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(172)

Unified Diff: sdk/lib/_internal/compiler/implementation/warnings.dart

Issue 25046002: Emit a compile-time error when a named optional parameter has a library private name. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/resolution/members.dart ('k') | tests/co19/co19-dart2dart.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 f0035ae53e19950059751fe6776a732df2977f36..7d5dcbf30e087af02b5bbb8efdbc1743bac34565 100644
--- a/sdk/lib/_internal/compiler/implementation/warnings.dart
+++ b/sdk/lib/_internal/compiler/implementation/warnings.dart
@@ -933,6 +933,13 @@ Use 'const #{name}' if possible.''');
"Error: '#{value}' is not a valid Symbol name because it starts with "
"'_'.");
+ static const MessageKind PRIVATE_NAMED_PARAMETER = const MessageKind(
+ "Error: Named optional parameter can't have a library private name.",
+ howToFix: "Try removing the '_' or making the parameter positional or "
+ "required.",
+ examples: const ["""foo({int _p}) {} main() => foo();"""]
+ );
+
static const MessageKind UNSUPPORTED_LITERAL_SYMBOL = const MessageKind(
"Internal Error: Symbol literal '##{value}' is currently unsupported.");
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/resolution/members.dart ('k') | tests/co19/co19-dart2dart.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698