Remove some hard coded bcheckExprOther checks

This commit is contained in:
Nigel Tao committed 2018-04-20 14:19:41 +10:00
1 parent bbe3eef04b
commit 90a794c0b8
1 file changed
+1 -5
+1 -5
View File
@@ -870,10 +870,6 @@ func (q *checker) bcheckExprOther(n *a.Expr, depth uint32) (*big.Int, *big.Int,
}
return nil, nil, nil
}
// TODO: delete this hack that only matches "foo.length(etc)".
if isThatMethod(q.tm, n, t.IDLength, 0) || isThatMethod(q.tm, n, t.IDAvailable, 0) {
break
}
if err := q.bcheckExprCall(n, depth); err != nil {
return nil, nil, err
@@ -987,7 +983,7 @@ func (q *checker) bcheckExprCall(n *a.Expr, depth uint32) error {
func makeSliceLengthExpr(slice *a.Expr) *a.Expr {
x := a.NewExpr(a.FlagsTypeChecked, t.IDDot, 0, t.IDLength, slice.Node(), nil, nil, nil)
x.SetMType(typeExprPlaceholder) // HACK.
x.SetMType(a.NewTypeExpr(t.IDOpenParen, 0, t.IDLength, slice.MType().Node(), nil, nil))
x = a.NewExpr(a.FlagsTypeChecked, t.IDOpenParen, 0, 0, x.Node(), nil, nil, nil)
x.SetMType(typeExprU64)
return x