struct Savi::Compiler::XTypes::IntersectionBasic
- Savi::Compiler::XTypes::IntersectionBasic
- Savi::Compiler::XTypes::AlgebraicTypeSummand
- Savi::Compiler::XTypes::AlgebraicType
- Struct
- Value
- Object
Overview
IntersectionBasic is a special case optimization of Intersection for the
very common case of intersecting a NominalType with a NominalCap.
We are able to represent them without an extra Set allocation,
and several operations are made more direct and efficient.
We also show the type to the user in a streamlined way, using the
standard Type'cap
designation (or Type
when it matches the default cap).
Defined in:
savi/compiler/xtypes/algebraic_type.crConstructors
Instance Method Summary
- #aliased
- #bind_variables(mapping : Hash(TypeVariable, AlgebraicType)) : Tuple(AlgebraicType, Bool)
- #intersect(other : AlgebraicType)
- #nominal_cap : NominalCap
- #nominal_type : NominalType
- #observe_assignment_reciprocals(pos : Source::Pos, supertype : AlgebraicType, maybe : Bool = false)
- #override_cap(cap : AlgebraicType)
- #show
- #stabilized
- #trace_as_assignment(cursor : Cursor)
- #trace_as_constraint(cursor : Cursor)
- #trace_call_return_as_assignment(cursor : Cursor, call : AST::Call)
- #viewed_from(origin)
Instance methods inherited from struct Savi::Compiler::XTypes::AlgebraicTypeSummand
unite(other : AlgebraicType)
unite
Instance methods inherited from struct Savi::Compiler::XTypes::AlgebraicType
aliased
aliased,
bind_variables(mapping : Hash(TypeVariable, AlgebraicType)) : Tuple(AlgebraicType, Bool)
bind_variables,
initialize
initialize,
inspect
inspect,
intersect(other : AlgebraicType)
intersect,
is_assignment_based_on_input_var? : Bool
is_assignment_based_on_input_var?,
observe_assignment_reciprocals(pos : Source::Pos, supertype : AlgebraicType, maybe : Bool = false)
observe_assignment_reciprocals,
override_cap(cap : AlgebraicType)
override_cap,
show
show,
stabilized
stabilized,
trace_as_assignment(cursor : Cursor)
trace_as_assignment,
trace_as_constraint(cursor : Cursor)
trace_as_constraint,
trace_call_return_as_assignment(cursor : Cursor, call : AST::Call)
trace_call_return_as_assignment,
viewed_from(origin)
viewed_from
Constructor methods inherited from struct Savi::Compiler::XTypes::AlgebraicType
new
new
Constructor Detail
def self.new(nominal_type : Savi::Compiler::XTypes::NominalType, nominal_cap : Savi::Compiler::XTypes::NominalCap)
#
Instance Method Detail
def observe_assignment_reciprocals(pos : Source::Pos, supertype : AlgebraicType, maybe : Bool = false)
#