From e842f6af3a48fbfd686d3e1d41614075227fa985 Mon Sep 17 00:00:00 2001 From: David Symonds Date: Mon, 14 Dec 2015 11:44:26 +1100 Subject: [PATCH] go/types: Remove ancient Go 1.1 compatibility indirections. Change-Id: Ie16cc01ea2bd4806eaa7bd77cfbd2fa90f11ea36 Reviewed-on: https://go-review.googlesource.com/17792 Reviewed-by: Brad Fitzpatrick --- go/types/expr.go | 4 ++-- go/types/go11.go | 17 ----------------- go/types/go12.go | 17 ----------------- 3 files changed, 2 insertions(+), 36 deletions(-) delete mode 100644 go/types/go11.go delete mode 100644 go/types/go12.go 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 -}