github.com/goplus/igop@v0.17.0/cmd/igop/gox_support.go (about)

     1  //go:build go1.18
     2  // +build go1.18
     3  
     4  package main
     5  
     6  import (
     7  	"go/ast"
     8  	"go/constant"
     9  	"go/token"
    10  	"go/types"
    11  	_ "unsafe"
    12  
    13  	"github.com/goplus/igop"
    14  )
    15  
    16  type operandMode byte
    17  type builtinId int
    18  
    19  type operand struct {
    20  	mode operandMode
    21  	expr ast.Expr
    22  	typ  types.Type
    23  	val  constant.Value
    24  	id   builtinId
    25  }
    26  
    27  type positioner interface {
    28  	Pos() token.Pos
    29  }
    30  
    31  //go:linkname checker_infer go/types.(*Checker).infer
    32  func checker_infer(check *types.Checker, posn positioner, tparams []*types.TypeParam, targs []types.Type, params *types.Tuple, args []*operand) (result []types.Type)
    33  
    34  func init() {
    35  	// support github.com/goplus/gox.checker_infer
    36  	igop.RegisterExternal("go/types.(*Checker).infer", checker_infer)
    37  }