Index: lib/src/codegen/side_effect_analysis.dart |
diff --git a/lib/src/codegen/side_effect_analysis.dart b/lib/src/codegen/side_effect_analysis.dart |
index 3126291e200b40c3e022012314b6bb328d9c7fe0..8fa095285c06a802e9b459fb79567e8ff7c8dd2e 100644 |
--- a/lib/src/codegen/side_effect_analysis.dart |
+++ b/lib/src/codegen/side_effect_analysis.dart |
@@ -36,8 +36,9 @@ bool isStateless(Expression node, [AstNode context]) { |
if (node is ThisExpression || node is SuperExpression) return true; |
if (node is SimpleIdentifier) { |
var e = node.staticElement; |
- if (e is PropertyAccessorElement) e = |
- (e as PropertyAccessorElement).variable; |
+ if (e is PropertyAccessorElement) { |
+ e = e.variable; |
+ } |
if (e is VariableElement && !e.isSynthetic) { |
if (e.isFinal) return true; |
if (e is LocalVariableElement || e is ParameterElement) { |
@@ -77,12 +78,15 @@ class _AssignmentFinder extends RecursiveAstVisitor { |
visitSimpleIdentifier(SimpleIdentifier node) { |
// Ignore if qualified. |
AstNode parent = node.parent; |
- if (parent is PrefixedIdentifier && |
- identical(parent.identifier, node)) return; |
- if (parent is PropertyAccess && |
- identical(parent.propertyName, node)) return; |
- if (parent is MethodInvocation && |
- identical(parent.methodName, node)) return; |
+ if (parent is PrefixedIdentifier && identical(parent.identifier, node)) { |
+ return; |
+ } |
+ if (parent is PropertyAccess && identical(parent.propertyName, node)) { |
+ return; |
+ } |
+ if (parent is MethodInvocation && identical(parent.methodName, node)) { |
+ return; |
+ } |
if (parent is ConstructorName) return; |
if (parent is Label) return; |