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

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

Issue 24267002: Emit compile-time error on 'const' formal parameters. (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 6fb63fa8829becf9bfe1d45c66e5015f149598d7..bd06786f895183766f130b48cb048047c567f3ec 100644
--- a/sdk/lib/_internal/compiler/implementation/warnings.dart
+++ b/sdk/lib/_internal/compiler/implementation/warnings.dart
@@ -550,6 +550,20 @@ main() {
F f;
}"""]);
+ static const MessageKind FORMAL_DECLARED_CONST = const MessageKind(
+ "Error: A formal parameter can't be declared const.",
+ howToFix: "Try removing 'const'.",
+ examples: const ["""
+foo(const x) {}
+main() => foo(42);
+""", """
+foo({const x}) {}
+main() => foo(42);
+""", """
+foo([const x]) {}
+main() => foo(42);
+"""]);
+
static const MessageKind CANNOT_INSTANTIATE_TYPE_VARIABLE = const MessageKind(
'Error: Cannot instantiate type variable "#{typeVariableName}".');
« 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