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

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

Issue 1225273002: Remove flag for enabling null-aware operators. They are now on by default. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 5 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
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 1184 matching lines...) Expand 10 before | Expand all | Expand 10 after
1195 "Cannot assign a value to method '#{name}' " 1195 "Cannot assign a value to method '#{name}' "
1196 "in superclass '#{superclassName}'."); 1196 "in superclass '#{superclassName}'.");
1197 1197
1198 static const MessageKind ASSIGNING_TYPE = const MessageKind( 1198 static const MessageKind ASSIGNING_TYPE = const MessageKind(
1199 "Cannot assign a value to a type."); 1199 "Cannot assign a value to a type.");
1200 1200
1201 static const MessageKind IF_NULL_ASSIGNING_TYPE = const MessageKind( 1201 static const MessageKind IF_NULL_ASSIGNING_TYPE = const MessageKind(
1202 "Cannot assign a value to a type. Note that types are never null, " 1202 "Cannot assign a value to a type. Note that types are never null, "
1203 "so this ??= assignment has no effect.", 1203 "so this ??= assignment has no effect.",
1204 howToFix: "Try removing the '??=' assignment.", 1204 howToFix: "Try removing the '??=' assignment.",
1205 options: const ['--enable-null-aware-operators'],
1206 examples: const [ 1205 examples: const [
1207 "class A {} main() { print(A ??= 3);}", 1206 "class A {} main() { print(A ??= 3);}",
1208 ]); 1207 ]);
1209 1208
1210 static const MessageKind VOID_NOT_ALLOWED = const MessageKind( 1209 static const MessageKind VOID_NOT_ALLOWED = const MessageKind(
1211 "Type 'void' can't be used here because it isn't a return type.", 1210 "Type 'void' can't be used here because it isn't a return type.",
1212 howToFix: "Try removing 'void' keyword or replace it with 'var', 'final'," 1211 howToFix: "Try removing 'void' keyword or replace it with 'var', 'final',"
1213 " or a type.", 1212 " or a type.",
1214 examples: const [ 1213 examples: const [
1215 "void x; main() {}", 1214 "void x; main() {}",
(...skipping 799 matching lines...) Expand 10 before | Expand all | Expand 10 after
2015 examples: const[ 2014 examples: const[
2016 "main(", 2015 "main(",
2017 "main(){", 2016 "main(){",
2018 "main(){]}", 2017 "main(){]}",
2019 ]); 2018 ]);
2020 2019
2021 static const MessageKind UNTERMINATED_TOKEN = const MessageKind( 2020 static const MessageKind UNTERMINATED_TOKEN = const MessageKind(
2022 // This is a fall-back message that shouldn't happen. 2021 // This is a fall-back message that shouldn't happen.
2023 "Incomplete token."); 2022 "Incomplete token.");
2024 2023
2025 static const MessageKind NULL_AWARE_OPERATORS_DISABLED = const MessageKind(
2026 "Null-aware operators like '#{operator}' are currently experimental. "
2027 "You can enable them using the --enable-null-aware-operators flag.");
2028
2029 static const MessageKind EXPONENT_MISSING = const MessageKind( 2024 static const MessageKind EXPONENT_MISSING = const MessageKind(
2030 "Numbers in exponential notation should always contain an exponent" 2025 "Numbers in exponential notation should always contain an exponent"
2031 " (an integer number with an optional sign).", 2026 " (an integer number with an optional sign).",
2032 howToFix: "Make sure there is an exponent, and remove any whitespace " 2027 howToFix: "Make sure there is an exponent, and remove any whitespace "
2033 "before it.", 2028 "before it.",
2034 examples: const [""" 2029 examples: const ["""
2035 main() { 2030 main() {
2036 var i = 1e; 2031 var i = 1e;
2037 } 2032 }
2038 """]); 2033 """]);
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after
2613 static String convertToString(value) { 2608 static String convertToString(value) {
2614 if (value is ErrorToken) { 2609 if (value is ErrorToken) {
2615 // Shouldn't happen. 2610 // Shouldn't happen.
2616 return value.assertionMessage; 2611 return value.assertionMessage;
2617 } else if (value is Token) { 2612 } else if (value is Token) {
2618 value = value.value; 2613 value = value.value;
2619 } 2614 }
2620 return '$value'; 2615 return '$value';
2621 } 2616 }
2622 } 2617 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/scanner/utf8_bytes_scanner.dart ('k') | tests/language/nullaware_opt_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698