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 4cccd421fccccdeddabf066261ee7d729f32a1cf..cdf8e7939a358a1f9b5c7bb2d7f11865e79376a5 100644 |
--- a/lib/src/codegen/side_effect_analysis.dart |
+++ b/lib/src/codegen/side_effect_analysis.dart |
@@ -28,6 +28,8 @@ import 'package:analyzer/src/generated/element.dart'; |
/// correctness of a `true` value. However it may return `false` for things |
/// that are in fact, stateless. |
bool isStateless(Expression node, [AstNode context]) { |
+ // `this` and `super` cannot be reassigned. |
+ if (node is ThisExpression || node is SuperExpression) return true; |
if (node is SimpleIdentifier) { |
var e = node.staticElement; |
if (e is PropertyAccessorElement) e = e.variable; |