From 90a794c0b8f62381f62a1ca0dff2522a297283ef Mon Sep 17 00:00:00 2001 From: Nigel Tao Date: Fri, 20 Apr 2018 14:19:41 +1000 Subject: [PATCH] Remove some hard coded bcheckExprOther checks --- lang/check/bounds.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lang/check/bounds.go b/lang/check/bounds.go index 4a5f374e..6b246a4e 100644 --- a/lang/check/bounds.go +++ b/lang/check/bounds.go @@ -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