check: drop more facts when calling coroutines

This commit is contained in:
Nigel Tao committed 2024-07-09 14:11:31 +10:00
1 parent cc9ee184d0
commit f37cfcf554
4 files changed
+116 -79

No files matched your search

+6 -6
View File
@@ -463,18 +463,18 @@ func (q *checker) bcheckAssignment(lhs *a.Expr, op t.ID, rhs *a.Expr) error {
lTyp = lhs.MType()
}
if (rhs.Operator() == a.ExprOperatorCall) && rhs.Effect().Coroutine() && (op != t.IDEqQuestion) {
if err := q.facts.update(updateFactsForSuspension); err != nil {
return err
}
}
nb, err := q.bcheckAssignment1(lhs, lTyp, op, rhs)
if err != nil {
return err
}
if (rhs.Operator() == a.ExprOperatorCall) && rhs.Effect().Impure() {
if rhs.Effect().Coroutine() && (op != t.IDEqQuestion) {
if err := q.facts.update(updateFactsForSuspension); err != nil {
return err
}
}
recv := rhs.LHS().AsExpr().LHS().AsExpr()
if err := q.facts.update(func(x *a.Expr) (*a.Expr, error) {
if _, ok := oldFacts[x]; !ok {