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

Side by Side Diff: pkg/compiler/lib/src/warnings.dart

Issue 1151163004: Implementation of null-aware operators. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 7 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
« no previous file with comments | « pkg/compiler/lib/src/universe/universe.dart ('k') | tests/compiler/dart2js/parser_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 = "Computer says no!"; 7 const DONT_KNOW_HOW_TO_FIX = "Computer says no!";
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 1157 matching lines...) Expand 10 before | Expand all | Expand 10 after
1168 static const MessageKind ASSIGNING_METHOD = const MessageKind( 1168 static const MessageKind ASSIGNING_METHOD = const MessageKind(
1169 "Cannot assign a value to a method."); 1169 "Cannot assign a value to a method.");
1170 1170
1171 static const MessageKind ASSIGNING_METHOD_IN_SUPER = const MessageKind( 1171 static const MessageKind ASSIGNING_METHOD_IN_SUPER = const MessageKind(
1172 "Cannot assign a value to method '#{name}' " 1172 "Cannot assign a value to method '#{name}' "
1173 "in superclass '#{superclassName}'."); 1173 "in superclass '#{superclassName}'.");
1174 1174
1175 static const MessageKind ASSIGNING_TYPE = const MessageKind( 1175 static const MessageKind ASSIGNING_TYPE = const MessageKind(
1176 "Cannot assign a value to a type."); 1176 "Cannot assign a value to a type.");
1177 1177
1178 static const MessageKind IF_NULL_ASSIGNING_TYPE = const MessageKind(
1179 "Cannot assign a value to a type. Note that types are never null, "
1180 "so this ??= assignment has no effect.",
1181 howToFix: "Try removing the '??=' assignment.",
1182 options: const ['--enable-null-aware-operators'],
1183 examples: const [
1184 "class A {} main() { print(A ??= 3);}",
1185 ]);
1186
1178 static const MessageKind VOID_NOT_ALLOWED = const MessageKind( 1187 static const MessageKind VOID_NOT_ALLOWED = const MessageKind(
1179 "Type 'void' can't be used here because it isn't a return type.", 1188 "Type 'void' can't be used here because it isn't a return type.",
1180 howToFix: "Try removing 'void' keyword or replace it with 'var', 'final'," 1189 howToFix: "Try removing 'void' keyword or replace it with 'var', 'final',"
1181 " or a type.", 1190 " or a type.",
1182 examples: const [ 1191 examples: const [
1183 "void x; main() {}", 1192 "void x; main() {}",
1184 "foo(void x) {} main() { foo(null); }", 1193 "foo(void x) {} main() { foo(null); }",
1185 ]); 1194 ]);
1186 1195
1187 static const MessageKind NULL_NOT_ALLOWED = const MessageKind( 1196 static const MessageKind NULL_NOT_ALLOWED = const MessageKind(
(...skipping 774 matching lines...) Expand 10 before | Expand all | Expand 10 after
1962 examples: const[ 1971 examples: const[
1963 "main(", 1972 "main(",
1964 "main(){", 1973 "main(){",
1965 "main(){]}", 1974 "main(){]}",
1966 ]); 1975 ]);
1967 1976
1968 static const MessageKind UNTERMINATED_TOKEN = const MessageKind( 1977 static const MessageKind UNTERMINATED_TOKEN = const MessageKind(
1969 // This is a fall-back message that shouldn't happen. 1978 // This is a fall-back message that shouldn't happen.
1970 "Incomplete token."); 1979 "Incomplete token.");
1971 1980
1981 static const MessageKind NULL_AWARE_OPERATORS_DISABLED = const MessageKind(
1982 "Null-aware operators like '#{operator}' are currently experimental. "
1983 "You can enable them using the --enable-null-aware-operators flag.");
1984
1972 static const MessageKind EXPONENT_MISSING = const MessageKind( 1985 static const MessageKind EXPONENT_MISSING = const MessageKind(
1973 "Numbers in exponential notation should always contain an exponent" 1986 "Numbers in exponential notation should always contain an exponent"
1974 " (an integer number with an optional sign).", 1987 " (an integer number with an optional sign).",
1975 howToFix: "Make sure there is an exponent, and remove any whitespace " 1988 howToFix: "Make sure there is an exponent, and remove any whitespace "
1976 "before it.", 1989 "before it.",
1977 examples: const [""" 1990 examples: const ["""
1978 main() { 1991 main() {
1979 var i = 1e; 1992 var i = 1e;
1980 } 1993 }
1981 """]); 1994 """]);
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after
2556 static String convertToString(value) { 2569 static String convertToString(value) {
2557 if (value is ErrorToken) { 2570 if (value is ErrorToken) {
2558 // Shouldn't happen. 2571 // Shouldn't happen.
2559 return value.assertionMessage; 2572 return value.assertionMessage;
2560 } else if (value is Token) { 2573 } else if (value is Token) {
2561 value = value.value; 2574 value = value.value;
2562 } 2575 }
2563 return '$value'; 2576 return '$value';
2564 } 2577 }
2565 } 2578 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/universe/universe.dart ('k') | tests/compiler/dart2js/parser_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698