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

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

Issue 24091002: Emit a compile-time error when the name of a variable is referenced in the (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update co19 test expectations. 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
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 b55b0260f8c9119bd7be78b587d3f1e44eabf6f2..5a8ae00f3f5ed7358b3866a95dc3160e00bbf8ed 100644
--- a/sdk/lib/_internal/compiler/implementation/warnings.dart
+++ b/sdk/lib/_internal/compiler/implementation/warnings.dart
@@ -638,6 +638,21 @@ Length: #{length}''');
const MessageKind(
'Error: Top-level variable cannot be declared static.');
+ static const MessageKind REFERENCE_IN_INITIALIZATION = const MessageKind(
+ "Error: Variable '#{variableName}' is referenced during its "
+ "initialization.",
+ howToFix: "If you are trying to reference a shadowed variable, rename"
+ " one of the variables.",
+ examples: const ["""
+foo(t) {
+ var t = t;
+ return t;
+}
+
+main() => foo(1);
+"""]);
+
+
static const MessageKind WRONG_NUMBER_OF_ARGUMENTS_FOR_ASSERT =
const MessageKind(
'Error: Wrong number of arguments to assert. Should be 1, but given '
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/resolution/scope.dart ('k') | sdk/lib/_internal/lib/regexp_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698