mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-23 08:47:56 +01:00
Check foo is choosy in "choose foo = etc"
This commit is contained in:
1 parent
26c7fb941f
commit
df9ec5bfb6
1 file changed
+2
@@ -1145,6 +1145,8 @@ func (q *checker) tcheckChoose(n *a.Choose) error {
|
|||||||
f := q.c.funcs[fQQID]
|
f := q.c.funcs[fQQID]
|
||||||
if f == nil {
|
if f == nil {
|
||||||
return fmt.Errorf("check: no function named %q", fQQID.Str(q.tm))
|
return fmt.Errorf("check: no function named %q", fQQID.Str(q.tm))
|
||||||
|
} else if !f.Choosy() {
|
||||||
|
return fmt.Errorf("check: choose assignee %q is not choosy", fQQID[2].Str(q.tm))
|
||||||
}
|
}
|
||||||
for _, o := range n.Args() {
|
for _, o := range n.Args() {
|
||||||
o := o.AsExpr()
|
o := o.AsExpr()
|
||||||
|
|||||||
Reference in new issue
Block a user