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

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

Issue 2176693003: Issue a strong mode warning for type inference that is unsafe with AST-based summaries. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Address code review comments. Created 4 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 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 10d5a24933b1ca8a2c678e2c6e6efe9f8fa2ebc5..c13d6208740a103a6a5337487d2f924f4dc721ee 100644
--- a/pkg/analyzer/lib/src/generated/error.dart
+++ b/pkg/analyzer/lib/src/generated/error.dart
@@ -2881,6 +2881,7 @@ abstract class ErrorCode {
StrongModeCode.INVALID_SUPER_INVOCATION,
StrongModeCode.NON_GROUND_TYPE_CHECK_INFO,
StrongModeCode.STATIC_TYPE_ERROR,
+ StrongModeCode.UNSAFE_BLOCK_CLOSURE_INFERENCE,
TodoCode.TODO,
@@ -5897,6 +5898,11 @@ class StrongModeCode extends ErrorCode {
static const String _implicitCastMessage =
'Unsound implicit cast from {0} to {1}';
+ static const String _unsafeBlockClosureInferenceMessage =
+ 'Unsafe use of block closure in a type-inferred variable outside a '
+ 'function body. Workaround: add a type annotation for `{0}`. See '
+ 'dartbug.com/26947';
+
static const String _typeCheckMessage =
'Type check failed: {0} is not of type {1}';
@@ -6044,6 +6050,12 @@ class StrongModeCode extends ErrorCode {
"Missing type arguments for calling generic function type '{0}'"
"$_implicitDynamicTip");
+ static const StrongModeCode UNSAFE_BLOCK_CLOSURE_INFERENCE =
+ const StrongModeCode(
+ ErrorType.STATIC_WARNING,
+ 'UNSAFE_BLOCK_CLOSURE_INFERENCE',
+ _unsafeBlockClosureInferenceMessage);
+
@override
final ErrorType type;

Powered by Google App Engine
This is Rietveld 408576698