mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-23 16:52:18 +01:00
Remove some hard coded bcheckExprOther checks
This commit is contained in:
1 parent
4ddc2f0055
commit
ba0db5b4d1
1 file changed
+5
-4
@@ -854,10 +854,7 @@ func (q *checker) bcheckExprOther(n *a.Expr, depth uint32) (*big.Int, *big.Int,
|
|||||||
return nil, nil, nil
|
return nil, nil, nil
|
||||||
}
|
}
|
||||||
// TODO: delete this hack that only matches "foo.decode(etc)".
|
// TODO: delete this hack that only matches "foo.decode(etc)".
|
||||||
if isThatMethod(q.tm, n, q.tm.ByName("decode"), 2) ||
|
if isThatMethod(q.tm, n, q.tm.ByName("decode"), 3) {
|
||||||
isThatMethod(q.tm, n, q.tm.ByName("decode"), 3) ||
|
|
||||||
isThatMethod(q.tm, n, t.IDCopyFromSlice, 1) ||
|
|
||||||
isThatMethod(q.tm, n, q.tm.ByName("update"), 1) {
|
|
||||||
for _, o := range n.Args() {
|
for _, o := range n.Args() {
|
||||||
a := o.Arg().Value()
|
a := o.Arg().Value()
|
||||||
aMin, aMax, err := q.bcheckExpr(a, depth)
|
aMin, aMax, err := q.bcheckExpr(a, depth)
|
||||||
@@ -973,6 +970,10 @@ func (q *checker) bcheckExprCall(n *a.Expr, depth uint32) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
inFields := f.In().Fields()
|
inFields := f.In().Fields()
|
||||||
|
if len(inFields) != len(n.Args()) {
|
||||||
|
return fmt.Errorf("check: %q has %d arguments but %d were given",
|
||||||
|
lhs.MType().Str(q.tm), len(inFields), len(n.Args()))
|
||||||
|
}
|
||||||
for i, o := range n.Args() {
|
for i, o := range n.Args() {
|
||||||
if err := q.bcheckAssignment2(nil, inFields[i].Field().XType(), t.IDEq, o.Arg().Value()); err != nil {
|
if err := q.bcheckAssignment2(nil, inFields[i].Field().XType(), t.IDEq, o.Arg().Value()); err != nil {
|
||||||
return err
|
return err
|
||||||
|
|||||||
Reference in new issue
Block a user