mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-21 08:47:28 +01:00
Introduce finer-grained effects
This commit is contained in:
1 parent
77e538aec8
commit
0a47966e72
12 files changed
+129
-115
No files matched your search
@@ -382,7 +382,7 @@ func (q *checker) bcheckAssignment(lhs *a.Expr, op t.ID, rhs *a.Expr) error {
|
||||
return err
|
||||
}
|
||||
|
||||
if lhs.Pure() && rhs.Pure() && lhs.MType().IsNumType() {
|
||||
if lhs.Effect().Pure() && rhs.Effect().Pure() && lhs.MType().IsNumType() {
|
||||
o := a.NewExpr(0, t.IDXBinaryEqEq, 0, 0, lhs.AsNode(), nil, rhs.AsNode(), nil)
|
||||
o.SetMType(lhs.MType())
|
||||
q.facts.appendFact(o)
|
||||
|
||||
+1
-1
@@ -527,7 +527,7 @@ func (q *checker) tcheckExprCall(n *a.Expr, depth uint32) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if ne, fe := n.Effect(), f.Effect(); ne != fe {
|
||||
if ne, fe := n.Effect(), f.Effect(); ne|a.EffectRootCause != fe|a.EffectRootCause {
|
||||
return fmt.Errorf("check: %q has effect %q but %q has effect %q",
|
||||
n.Str(q.tm), ne, f.QQID().Str(q.tm), fe)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user