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

Unified Diff: pkg/analyzer/lib/src/generated/error.dart

Issue 1423623005: Report hint when target of an invocation uses '?.', so can be null. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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
Index: pkg/analyzer/lib/src/generated/error.dart
diff --git a/pkg/analyzer/lib/src/generated/error.dart b/pkg/analyzer/lib/src/generated/error.dart
index 5f7e3f68b267a65ef034d2799334fc637ca688ed..299dc1abb52ae93e765b98bc1706c93260ed9ea2 100644
--- a/pkg/analyzer/lib/src/generated/error.dart
+++ b/pkg/analyzer/lib/src/generated/error.dart
@@ -2932,6 +2932,15 @@ class HintCode extends ErrorCode {
"The argument type '{0}' cannot be assigned to the parameter type '{1}'");
/**
+ * When the target expression uses '?.' operator, it can be `null`, so all the
+ * subsequent invocations should also use '?.' operator.
+ */
+ static const HintCode CAN_BE_NULL_AFTER_NULL_AWARE = const HintCode(
+ 'CAN_BE_NULL_AFTER_NULL_AWARE',
+ "The expression uses '?.', so can be 'null'",
+ "Replace the '.' with a '?.' in the invocation");
+
+ /**
* Dead code is code that is never reached, this can happen for instance if a
* statement follows a return statement.
*/
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/resolver.dart » ('j') | pkg/analyzer/lib/src/generated/resolver.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698