Skip to content

Commit 75b2bb1

Browse files
ianlancetaylorgopherbot
authored andcommitted
cmd/cgo: drop pre-1.18 support
Now that the bootstrap compiler is 1.24, it's no longer needed. Change-Id: I9b3d6b7176af10fbc580173d50130120b542e7f9 Reviewed-on: https://go-review.googlesource.com/c/go/+/717060 Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Michael Pratt <mpratt@google.com> Auto-Submit: Ian Lance Taylor <iant@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
1 parent dd839f1 commit 75b2bb1

File tree

3 files changed

+9
-62
lines changed

3 files changed

+9
-62
lines changed

src/cmd/cgo/ast.go

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,8 @@ func (f *File) walk(x interface{}, context astContext, visit func(*File, interfa
363363

364364
// everything else just recurs
365365
default:
366-
f.walkUnexpected(x, context, visit)
366+
error_(token.NoPos, "unexpected type %T in walk", x)
367+
panic("unexpected type")
367368

368369
case nil:
369370

@@ -396,6 +397,9 @@ func (f *File) walk(x interface{}, context astContext, visit func(*File, interfa
396397
case *ast.IndexExpr:
397398
f.walk(&n.X, ctxExpr, visit)
398399
f.walk(&n.Index, ctxExpr, visit)
400+
case *ast.IndexListExpr:
401+
f.walk(&n.X, ctxExpr, visit)
402+
f.walk(n.Indices, ctxExpr, visit)
399403
case *ast.SliceExpr:
400404
f.walk(&n.X, ctxExpr, visit)
401405
if n.Low != nil {
@@ -434,8 +438,8 @@ func (f *File) walk(x interface{}, context astContext, visit func(*File, interfa
434438
case *ast.StructType:
435439
f.walk(n.Fields, ctxField, visit)
436440
case *ast.FuncType:
437-
if tparams := funcTypeTypeParams(n); tparams != nil {
438-
f.walk(tparams, ctxParam, visit)
441+
if n.TypeParams != nil {
442+
f.walk(n.TypeParams, ctxParam, visit)
439443
}
440444
f.walk(n.Params, ctxParam, visit)
441445
if n.Results != nil {
@@ -524,8 +528,8 @@ func (f *File) walk(x interface{}, context astContext, visit func(*File, interfa
524528
f.walk(n.Values, ctxExpr, visit)
525529
}
526530
case *ast.TypeSpec:
527-
if tparams := typeSpecTypeParams(n); tparams != nil {
528-
f.walk(tparams, ctxParam, visit)
531+
if n.TypeParams != nil {
532+
f.walk(n.TypeParams, ctxParam, visit)
529533
}
530534
f.walk(&n.Type, ctxType, visit)
531535

src/cmd/cgo/ast_go1.go

Lines changed: 0 additions & 25 deletions
This file was deleted.

src/cmd/cgo/ast_go118.go

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)