Index: src/ast/ast.cc |
diff --git a/src/ast/ast.cc b/src/ast/ast.cc |
index 1554a5e0b9761856b86ba99263743dc96c6627db..8529b5b445133571f9ceeb7c042f52f641d731df 100644 |
--- a/src/ast/ast.cc |
+++ b/src/ast/ast.cc |
@@ -125,6 +125,10 @@ bool Expression::ToBooleanIsFalse() const { |
} |
bool Expression::IsValidReferenceExpression() const { |
+ // We don't want expressions wrapped inside RewritableExpression to be |
+ // considered as valid reference expressions, as they will be rewritten |
+ // to something (most probably involving a do expression). |
+ if (IsRewritableExpression()) return false; |
Michael Starzinger
2016/07/18 13:08:04
I am confused, how can the below predicate return
Michael Starzinger
2016/07/18 13:10:13
Ah, now I see, the IsFoo predicates actually speci
nickie
2016/07/18 13:13:18
That's the point. They never should be. They nev
|
return IsProperty() || |
(IsVariableProxy() && AsVariableProxy()->IsValidReferenceExpression()); |
} |