mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-24 16:52:18 +01:00
Check that =? types are base.status
This commit is contained in:
1 parent
8926a85e15
commit
688e947016
1 file changed
+3
@@ -268,6 +268,9 @@ func (q *checker) tcheckAssign(n *a.Assign) error {
|
|||||||
rTyp := rhs.MType()
|
rTyp := rhs.MType()
|
||||||
|
|
||||||
if op := n.Operator(); op == t.IDEq || op == t.IDEqQuestion {
|
if op := n.Operator(); op == t.IDEq || op == t.IDEqQuestion {
|
||||||
|
if (op == t.IDEqQuestion) && !rTyp.Eq(typeExprStatus) {
|
||||||
|
return fmt.Errorf("check: =? only works with the base.status type")
|
||||||
|
}
|
||||||
return q.tcheckEq(0, lhs, lTyp, rhs, rTyp)
|
return q.tcheckEq(0, lhs, lTyp, rhs, rTyp)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user