mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-18 00:32:11 +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()
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user