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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of dart2js; 5 part of dart2js;
6 6
7 const DONT_KNOW_HOW_TO_FIX = ""; 7 const DONT_KNOW_HOW_TO_FIX = "";
8 8
9 /** 9 /**
10 * The messages in this file should meet the following guide lines: 10 * The messages in this file should meet the following guide lines:
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after
631 // This is used as an exception. 631 // This is used as an exception.
632 static const MessageKind INVALID_SOURCE_FILE_LOCATION = const MessageKind(''' 632 static const MessageKind INVALID_SOURCE_FILE_LOCATION = const MessageKind('''
633 Invalid offset (#{offset}) in source map. 633 Invalid offset (#{offset}) in source map.
634 File: #{fileName} 634 File: #{fileName}
635 Length: #{length}'''); 635 Length: #{length}''');
636 636
637 static const MessageKind TOP_LEVEL_VARIABLE_DECLARED_STATIC = 637 static const MessageKind TOP_LEVEL_VARIABLE_DECLARED_STATIC =
638 const MessageKind( 638 const MessageKind(
639 'Error: Top-level variable cannot be declared static.'); 639 'Error: Top-level variable cannot be declared static.');
640 640
641 static const MessageKind REFERENCE_IN_INITIALIZATION = const MessageKind(
642 "Error: Variable '#{variableName}' is referenced during its "
643 "initialization.",
644 howToFix: "If you are trying to reference a shadowed variable, rename"
645 " one of the variables.",
646 examples: const ["""
647 foo(t) {
648 var t = t;
649 return t;
650 }
651
652 main() => foo(1);
653 """]);
654
655
641 static const MessageKind WRONG_NUMBER_OF_ARGUMENTS_FOR_ASSERT = 656 static const MessageKind WRONG_NUMBER_OF_ARGUMENTS_FOR_ASSERT =
642 const MessageKind( 657 const MessageKind(
643 'Error: Wrong number of arguments to assert. Should be 1, but given ' 658 'Error: Wrong number of arguments to assert. Should be 1, but given '
644 '#{argumentCount}.'); 659 '#{argumentCount}.');
645 660
646 static const MessageKind ASSERT_IS_GIVEN_NAMED_ARGUMENTS = const MessageKind( 661 static const MessageKind ASSERT_IS_GIVEN_NAMED_ARGUMENTS = const MessageKind(
647 'Error: "assert" takes no named arguments, but given #{argumentCount}.'); 662 'Error: "assert" takes no named arguments, but given #{argumentCount}.');
648 663
649 static const MessageKind FACTORY_REDIRECTION_IN_NON_FACTORY = 664 static const MessageKind FACTORY_REDIRECTION_IN_NON_FACTORY =
650 const MessageKind( 665 const MessageKind(
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
1085 1100
1086 class CompileTimeConstantError extends Diagnostic { 1101 class CompileTimeConstantError extends Diagnostic {
1087 CompileTimeConstantError(MessageKind kind, Map arguments, bool terse) 1102 CompileTimeConstantError(MessageKind kind, Map arguments, bool terse)
1088 : super(kind, arguments, terse); 1103 : super(kind, arguments, terse);
1089 } 1104 }
1090 1105
1091 class CompilationError extends Diagnostic { 1106 class CompilationError extends Diagnostic {
1092 CompilationError(MessageKind kind, Map arguments, bool terse) 1107 CompilationError(MessageKind kind, Map arguments, bool terse)
1093 : super(kind, arguments, terse); 1108 : super(kind, arguments, terse);
1094 } 1109 }
OLDNEW
« 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