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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/warnings.dart
diff --git a/pkg/compiler/lib/src/warnings.dart b/pkg/compiler/lib/src/warnings.dart
index 8977b5d9220dfd3a363dbf728a4cec8f805dcfaa..3f47f629e6fc0101931619652e3e04abe728e991 100644
--- a/pkg/compiler/lib/src/warnings.dart
+++ b/pkg/compiler/lib/src/warnings.dart
@@ -1175,6 +1175,15 @@ main() => new C();"""]);
static const MessageKind ASSIGNING_TYPE = const MessageKind(
"Cannot assign a value to a type.");
+ static const MessageKind IF_NULL_ASSIGNING_TYPE = const MessageKind(
+ "Cannot assign a value to a type. Note that types are never null, "
+ "so this ??= assignment has no effect.",
+ howToFix: "Try removing the '??=' assignment.",
+ options: const ['--enable-null-aware-operators'],
+ examples: const [
+ "class A {} main() { print(A ??= 3);}",
+ ]);
+
static const MessageKind VOID_NOT_ALLOWED = const MessageKind(
"Type 'void' can't be used here because it isn't a return type.",
howToFix: "Try removing 'void' keyword or replace it with 'var', 'final',"
@@ -1969,6 +1978,10 @@ main() => r\"\"\"
// This is a fall-back message that shouldn't happen.
"Incomplete token.");
+ static const MessageKind NULL_AWARE_OPERATORS_DISABLED = const MessageKind(
+ "Null-aware operators like '#{operator}' are currently experimental. "
+ "You can enable them using the --enable-null-aware-operators flag.");
+
static const MessageKind EXPONENT_MISSING = const MessageKind(
"Numbers in exponential notation should always contain an exponent"
" (an integer number with an optional sign).",
« 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