go/src/cmd/compile/internal/types2/stmt.go

// decl may be nil
func (check *Checker) funcBody(decl *declInfo, name string, sig *Signature, body *syntax.BlockStmt, iota constant.Value) {}

func (check *Checker) usage(scope *Scope) {}

type stmtContext

const breakOk

const continueOk

const fallthroughOk

const finalSwitchCase

const inTypeSwitch

func (check *Checker) simpleStmt(s syntax.Stmt) {}

func trimTrailingEmptyStmts(list []syntax.Stmt) []syntax.Stmt {}

func (check *Checker) stmtList(ctxt stmtContext, list []syntax.Stmt) {}

func (check *Checker) multipleSwitchDefaults(list []*syntax.CaseClause) {}

func (check *Checker) multipleSelectDefaults(list []*syntax.CommClause) {}

func (check *Checker) openScope(node syntax.Node, comment string) {}

func (check *Checker) closeScope() {}

func (check *Checker) suspendedCall(keyword string, call syntax.Expr) {}

// goVal returns the Go value for val, or nil.
func goVal(val constant.Value) interface{}

type valueMap

type valueType

func (check *Checker) caseValues(x *operand, values []syntax.Expr, seen valueMap) {}

// isNil reports whether the expression e denotes the predeclared value nil.
func (check *Checker) isNil(e syntax.Expr) bool {}

// caseTypes typechecks the type expressions of a type case, checks for duplicate types
// using the seen map, and verifies that each type is valid with respect to the type of
// the operand x corresponding to the type switch expression. If that expression is not
// valid, x must be nil.
//
//	switch <x>.(type) {
//	case <types>: ...
//	...
//	}
//
// caseTypes returns the case-specific type for a variable v introduced through a short
// variable declaration by the type switch:
//
//	switch v := <x>.(type) {
//	case <types>: // T is the type of <v> in this case
//	...
//	}
//
// If there is exactly one type expression, T is the type of that expression. If there
// are multiple type expressions, or if predeclared nil is among the types, the result
// is the type of x. If x is invalid (nil), the result is the invalid type.
func (check *Checker) caseTypes(x *operand, types []syntax.Expr, seen map[Type]syntax.Expr) Type {}

// TODO(gri) Once we are certain that typeHash is correct in all situations, use this version of caseTypes instead.
// (Currently it may be possible that different types have identical names and import paths due to ImporterFrom.)
func (check *Checker) caseTypes_currently_unused(x *operand, xtyp *Interface, types []syntax.Expr, seen map[string]syntax.Expr) Type {}

// stmt typechecks statement s.
func (check *Checker) stmt(ctxt stmtContext, s syntax.Stmt) {}

func (check *Checker) switchStmt(inner stmtContext, s *syntax.SwitchStmt) {}

func (check *Checker) typeSwitchStmt(inner stmtContext, s *syntax.SwitchStmt, guard *syntax.TypeSwitchGuard) {}

func (check *Checker) rangeStmt(inner stmtContext, s *syntax.ForStmt, rclause *syntax.RangeClause) {}

// rangeKeyVal returns the key and value type produced by a range clause
// over an expression of type typ.
// If allowVersion != nil, it is used to check the required language version.
// If the range clause is not permitted, rangeKeyVal returns ok = false.
// When ok = false, rangeKeyVal may also return a reason in cause.
func rangeKeyVal(typ Type, allowVersion func(goVersion) bool) (key, val Type, cause string, ok bool) {}