From e2e4d7aa62866e266601e2089c80d5306c2efd92 Mon Sep 17 00:00:00 2001 From: Alan Donovan Date: Fri, 4 Nov 2016 21:02:15 +0000 Subject: [PATCH] go/ast/astutil: revert support for Go 1.8 type aliases This reverts commit 50193ec1c508c7b5714160a9c0979366fbbcabb4. Reason for revert: aliases will not be part of Go 1.8 Change-Id: Idb3b74243eeb8dbeb2a2f4bd69a248c1dafa5348 Reviewed-on: https://go-review.googlesource.com/32835 Reviewed-by: Robert Griesemer --- go/ast/astutil/enclosing18.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/go/ast/astutil/enclosing18.go b/go/ast/astutil/enclosing18.go index 4a91c1d3..af897cb0 100644 --- a/go/ast/astutil/enclosing18.go +++ b/go/ast/astutil/enclosing18.go @@ -200,11 +200,6 @@ func childrenOf(n ast.Node) []ast.Node { // Then add fake Nodes for bare tokens. switch n := n.(type) { - case *ast.AliasSpec: - // TODO(adonovan): AliasSpec.{Doc,Comment}? - // Guess position of "=>" assuming well-formattedness. - children = append(children, tok(n.Orig.Pos()-token.Pos(len("=> ")), len("=>"))) - case *ast.ArrayType: children = append(children, tok(n.Lbrack, len("[")), @@ -628,8 +623,7 @@ func NodeDescription(n ast.Node) string { return fmt.Sprintf("unary %s operation", n.Op) case *ast.ValueSpec: return "value specification" - case *ast.AliasSpec: - return "alias specification" + } panic(fmt.Sprintf("unexpected node type: %T", n)) }