diff --git a/go/types/expr.go b/go/types/expr.go index 6efc7b43..9770cd45 100644 --- a/go/types/expr.go +++ b/go/types/expr.go @@ -1246,7 +1246,7 @@ func (check *Checker) exprInternal(x *operand, e ast.Expr, hint Type) exprKind { switch typ := x.typ.Underlying().(type) { case *Basic: if isString(typ) { - if slice3(e) { + if e.Slice3 { check.invalidOp(x.pos(), "3-index slice of string") goto Error } @@ -1290,7 +1290,7 @@ func (check *Checker) exprInternal(x *operand, e ast.Expr, hint Type) exprKind { x.mode = value // spec: "Only the first index may be omitted; it defaults to 0." - if slice3(e) && (e.High == nil || sliceMax(e) == nil) { + if e.Slice3 && (e.High == nil || e.Max == nil) { check.error(e.Rbrack, "2nd and 3rd index required in 3-index slice") goto Error } diff --git a/go/types/go11.go b/go/types/go11.go deleted file mode 100644 index cf41cabe..00000000 --- a/go/types/go11.go +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !go1.2 - -package types - -import "go/ast" - -func slice3(x *ast.SliceExpr) bool { - return false -} - -func sliceMax(x *ast.SliceExpr) ast.Expr { - return nil -} diff --git a/go/types/go12.go b/go/types/go12.go deleted file mode 100644 index 20174421..00000000 --- a/go/types/go12.go +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build go1.2 - -package types - -import "go/ast" - -func slice3(x *ast.SliceExpr) bool { - return x.Slice3 -} - -func sliceMax(x *ast.SliceExpr) ast.Expr { - return x.Max -}