Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsSubtype ¶
func IsSubtype(e *Environment, t1, t2 types.Type) bool
IsSubType checks t1 <: t2 or not.
func TypeCheckExpr ¶
func TypeCheckExpr(env *Environment, expr ast.Expr) types.Type
Types ¶
type Environment ¶
type Environment struct {
// ExplicitRefinementMap is explicitly defined refinements.
ExplicitRefinementMap ObjectRefinementMap
// ImplicitRefinementMap is implicitly reasoned refinements, like assignment.
ImplicitRefinementMap ObjectRefinementMap
// Scope is current scope to type check
Scope *types.Scope
// Scope is current pos to type check
Pos token.Pos
// Pass is current analysis pass
Pass *analysis.Pass
// contains filtered or unexported fields
}
func NewEnvironment ¶
func NewEnvironment(pass *analysis.Pass) *Environment
NewEnvironment creates new type environment with current analysis pass.
func (*Environment) AddFunArgRefinement ¶
func (env *Environment) AddFunArgRefinement(label string, typ types.Type)
func (*Environment) ClearFunArgRefinement ¶
func (env *Environment) ClearFunArgRefinement()
func (*Environment) Embedding ¶
func (env *Environment) Embedding() ast.Expr
func (*Environment) RefinementTypeOf ¶
func (env *Environment) RefinementTypeOf(object types.Object) types.Type
type NameRefinementMap ¶
Click to show internal directories.
Click to hide internal directories.