// Copyright 2021 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.

package typeparams

import (
	
	
)

func ( ast.Expr,  token.Pos,  []ast.Expr,  token.Pos) ast.Expr {
	switch len() {
	case 0:
		panic("internal error: PackIndexExpr with empty expr slice")
	case 1:
		return &ast.IndexExpr{
			X:      ,
			Lbrack: ,
			Index:  [0],
			Rbrack: ,
		}
	default:
		return &ast.IndexListExpr{
			X:       ,
			Lbrack:  ,
			Indices: ,
			Rbrack:  ,
		}
	}
}

// IndexExpr wraps an ast.IndexExpr or ast.IndexListExpr.
//
// Orig holds the original ast.Expr from which this IndexExpr was derived.
type IndexExpr struct {
	Orig ast.Expr // the wrapped expr, which may be distinct from the IndexListExpr below.
	*ast.IndexListExpr
}

func ( ast.Node) *IndexExpr {
	switch e := .(type) {
	case *ast.IndexExpr:
		return &IndexExpr{, &ast.IndexListExpr{
			X:       .X,
			Lbrack:  .Lbrack,
			Indices: []ast.Expr{.Index},
			Rbrack:  .Rbrack,
		}}
	case *ast.IndexListExpr:
		return &IndexExpr{, }
	}
	return nil
}