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

Unified Diff: pkg/analyzer/lib/src/task/strong/ast_properties.dart

Issue 2362563004: re-land fix #27110 with proper DDC side of changes (Closed)
Patch Set: add tests Created 4 years, 3 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/analyzer/lib/src/error/codes.dart ('k') | pkg/analyzer/lib/src/task/strong/checker.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/task/strong/ast_properties.dart
diff --git a/pkg/analyzer/lib/src/task/strong/ast_properties.dart b/pkg/analyzer/lib/src/task/strong/ast_properties.dart
index 52f27f1cef073a1a4c08ca0044870dd352dad34a..0f93adafca085809e4b0c8e0414bb1eabc547188 100644
--- a/pkg/analyzer/lib/src/task/strong/ast_properties.dart
+++ b/pkg/analyzer/lib/src/task/strong/ast_properties.dart
@@ -10,6 +10,7 @@
import 'package:analyzer/analyzer.dart';
import 'package:analyzer/dart/element/type.dart';
+const String _implicitAssignmentCast = '_implicitAssignmentCast';
const String _implicitCast = '_implicitCast';
const String _hasImplicitCasts = '_hasImplicitCasts';
const String _isDynamicInvoke = '_isDynamicInvoke';
@@ -37,6 +38,17 @@ void setImplicitCast(Expression node, DartType type) {
node.setProperty(_implicitCast, type);
}
+/// If this op-assign has an implicit cast on the assignment, returns the type
+/// it is coerced to, otherwise returns null.
+DartType getImplicitAssignmentCast(Expression node) {
+ return node.getProperty/*<DartType>*/(_implicitAssignmentCast);
+}
+
+/// Sets the result of [getImplicitAssignmentCast] for this node.
+void setImplicitAssignmentCast(Expression node, DartType type) {
+ node.setProperty(_implicitAssignmentCast, type);
+}
+
/// True if this node is a dynamic operation that requires dispatch and/or
/// checking at runtime.
bool isDynamicInvoke(Expression node) {
« no previous file with comments | « pkg/analyzer/lib/src/error/codes.dart ('k') | pkg/analyzer/lib/src/task/strong/checker.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698