go/src/cmd/compile/internal/typecheck/typecheck.go

func AssignExpr(n ir.Node) ir.Node {}

func Expr(n ir.Node) ir.Node       {}

func Stmt(n ir.Node) ir.Node       {}

func Exprs(exprs []ir.Node) {}

func Stmts(stmts []ir.Node) {}

func Call(pos src.XPos, callee ir.Node, args []ir.Node, dots bool) ir.Node {}

func Callee(n ir.Node) ir.Node {}

var traceIndent

func tracePrint(title string, n ir.Node) func(np *ir.Node) {}

const ctxStmt

const ctxExpr

const ctxType

const ctxCallee

const ctxMultiOK

const ctxAssign

func typecheckslice(l []ir.Node, top int) {}

var _typekind

func typekind(t *types.Type) string {}

// typecheck type checks node n.
// The result of typecheck MUST be assigned back to n, e.g.
//
//	n.Left = typecheck(n.Left, top)
func typecheck(n ir.Node, top int) (res ir.Node) {}

// indexlit implements typechecking of untyped values as
// array/slice indexes. It is almost equivalent to DefaultLit
// but also accepts untyped numeric values representable as
// value of type int (see also checkmake for comparison).
// The result of indexlit MUST be assigned back to n, e.g.
//
//	n.Left = indexlit(n.Left)
func indexlit(n ir.Node) ir.Node {}

// typecheck1 should ONLY be called from typecheck.
func typecheck1(n ir.Node, top int) ir.Node {}

func typecheckargs(n ir.InitNode) {}

// RewriteNonNameCall replaces non-Name call expressions with temps,
// rewriting f()(...) to t0 := f(); t0(...).
func RewriteNonNameCall(n *ir.CallExpr) {}

// RewriteMultiValueCall rewrites multi-valued f() to use temporaries,
// so the backend wouldn't need to worry about tuple-valued expressions.
func RewriteMultiValueCall(n ir.InitNode, call ir.Node) {}

func checksliceindex(r ir.Node) bool {}

// The result of implicitstar MUST be assigned back to n, e.g.
//
//	n.Left = implicitstar(n.Left)
func implicitstar(n ir.Node) ir.Node {}

func needOneArg(n *ir.CallExpr, f string, args ...interface{}

func needTwoArgs(n *ir.CallExpr) (ir.Node, ir.Node, bool) {}

// Lookdot1 looks up the specified method s in the list fs of methods, returning
// the matching field or nil. If dostrcmp is 0, it matches the symbols. If
// dostrcmp is 1, it matches by name exactly. If dostrcmp is 2, it matches names
// with case folding.
func Lookdot1(errnode ir.Node, s *types.Sym, t *types.Type, fs []*types.Field, dostrcmp int) *types.Field {}

// NewMethodExpr returns an OMETHEXPR node representing method
// expression "recv.sym".
func NewMethodExpr(pos src.XPos, recv *types.Type, sym *types.Sym) *ir.SelectorExpr {}

func derefall(t *types.Type) *types.Type {}

// Lookdot looks up field or method n.Sel in the type t and returns the matching
// field. It transforms the op of node n to ODOTINTER or ODOTMETH, if appropriate.
// It also may add a StarExpr node to n.X as needed for access to non-pointer
// methods. If dostrcmp is 0, it matches the field/method with the exact symbol
// as n.Sel (appropriate for exported fields). If dostrcmp is 1, it matches by name
// exactly. If dostrcmp is 2, it matches names with case folding.
func Lookdot(n *ir.SelectorExpr, t *types.Type, dostrcmp int) *types.Field {}

func nokeys(l ir.Nodes) bool {}

func hasddd(params []*types.Field) bool {}

// typecheck assignment: type list = expression list
func typecheckaste(op ir.Op, call ir.Node, isddd bool, params []*types.Field, nl ir.Nodes, desc func() string) {}

// type check composite.
func fielddup(name string, hash map[string]bool) {}

// typecheckarraylit type-checks a sequence of slice/array literal elements.
func typecheckarraylit(elemType *types.Type, bound int64, elts []ir.Node, ctx string) int64 {}

// visible reports whether sym is exported or locally defined.
func visible(sym *types.Sym) bool {}

// nonexported reports whether sym is an unexported field.
func nonexported(sym *types.Sym) bool {}

func checklvalue(n ir.Node, verb string) {}

func checkassign(n ir.Node) {}

func checkassignto(src *types.Type, dst ir.Node) {}

// The result of stringtoruneslit MUST be assigned back to n, e.g.
//
//	n.Left = stringtoruneslit(n.Left)
func stringtoruneslit(n *ir.ConvExpr) ir.Node {}

func checkmake(t *types.Type, arg string, np *ir.Node) bool {}

// checkunsafesliceorstring is like checkmake but for unsafe.{Slice,String}.
func checkunsafesliceorstring(op ir.Op, np *ir.Node) bool {}

func Conv(n ir.Node, t *types.Type) ir.Node {}

// ConvNop converts node n to type t using the OCONVNOP op
// and typechecks the result with ctxExpr.
func ConvNop(n ir.Node, t *types.Type) ir.Node {}