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

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: 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..8da46ff1ec5989bd2f40e242ed63aaa8b1a168cc 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 trying to reference a shadowed variable, rename"
ngeoffray 2013/09/10 11:39:48 If you are
karlklose 2013/09/10 11:45:53 Done.
+ "one of the variables.",
+ examples: const["""
ngeoffray 2013/09/10 11:39:48 space before [.
karlklose 2013/09/10 11:45:53 Done.
+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 '

Powered by Google App Engine
This is Rietveld 408576698