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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/warnings.dart

Issue 23979004: Check for uninitialized constant variables. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebased 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 765 matching lines...) Expand 10 before | Expand all | Expand 10 after
776 " one of the variables.", 776 " one of the variables.",
777 examples: const [""" 777 examples: const ["""
778 foo(t) { 778 foo(t) {
779 var t = t; 779 var t = t;
780 return t; 780 return t;
781 } 781 }
782 782
783 main() => foo(1); 783 main() => foo(1);
784 """]); 784 """]);
785 785
786 static const MessageKind CONST_WITHOUT_INITIALIZER = const MessageKind(
787 "Error: A constant variable must be initialized.",
788 howToFix: "Try adding an initializer or "
789 "removing the 'const' modifier.",
790 examples: const ["""
791 void main() {
792 const c; // This constant variable must be initialized.
793 }"""]);
794
786 795
787 static const MessageKind WRONG_NUMBER_OF_ARGUMENTS_FOR_ASSERT = 796 static const MessageKind WRONG_NUMBER_OF_ARGUMENTS_FOR_ASSERT =
788 const MessageKind( 797 const MessageKind(
789 'Error: Wrong number of arguments to assert. Should be 1, but given ' 798 'Error: Wrong number of arguments to assert. Should be 1, but given '
790 '#{argumentCount}.'); 799 '#{argumentCount}.');
791 800
792 static const MessageKind ASSERT_IS_GIVEN_NAMED_ARGUMENTS = const MessageKind( 801 static const MessageKind ASSERT_IS_GIVEN_NAMED_ARGUMENTS = const MessageKind(
793 'Error: "assert" takes no named arguments, but given #{argumentCount}.'); 802 'Error: "assert" takes no named arguments, but given #{argumentCount}.');
794 803
795 static const MessageKind FACTORY_REDIRECTION_IN_NON_FACTORY = 804 static const MessageKind FACTORY_REDIRECTION_IN_NON_FACTORY =
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after
1238 1247
1239 class CompileTimeConstantError extends Diagnostic { 1248 class CompileTimeConstantError extends Diagnostic {
1240 CompileTimeConstantError(MessageKind kind, Map arguments, bool terse) 1249 CompileTimeConstantError(MessageKind kind, Map arguments, bool terse)
1241 : super(kind, arguments, terse); 1250 : super(kind, arguments, terse);
1242 } 1251 }
1243 1252
1244 class CompilationError extends Diagnostic { 1253 class CompilationError extends Diagnostic {
1245 CompilationError(MessageKind kind, Map arguments, bool terse) 1254 CompilationError(MessageKind kind, Map arguments, bool terse)
1246 : super(kind, arguments, terse); 1255 : super(kind, arguments, terse);
1247 } 1256 }
OLDNEW
« 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