struct Savi::Compiler::Infer::MetaType
- Savi::Compiler::Infer::MetaType
- Struct
- Value
- Object
Defined in:
savi/compiler/infer/meta_type.crConstructors
- .new(defn : ReifiedType, cap : String | Nil = nil)
- .new(defn : ReifiedType, cap : Cap)
- .new(defn : ReifiedTypeAlias)
- .new(inner : Savi::Compiler::Infer::MetaType::AntiNominal | Savi::Compiler::Infer::MetaType::Capability | Savi::Compiler::Infer::MetaType::Intersection | Savi::Compiler::Infer::MetaType::Nominal | Savi::Compiler::Infer::MetaType::Unconstrained | Savi::Compiler::Infer::MetaType::Union | Savi::Compiler::Infer::MetaType::Unsatisfiable)
Class Method Summary
- .cap(name : String)
- .cap(cap : Cap)
- .new_alias(defn : ReifiedTypeAlias)
- .new_intersection(types : Iterable(MetaType))
- .new_nominal(defn : ReifiedType)
- .new_type_param(defn : TypeParam)
- .new_union(types : Iterable(MetaType))
- .unconstrained
- .unsatisfiable
Instance Method Summary
- #&(other : MetaType)
- #-
- #|(other : MetaType)
- #aliased
- #any_callable_func_defn_type(ctx, name : String) : ReifiedType | Nil
- #any_type_alias_in_first_layer?
- #cap(name : String)
- #cap(cap : Cap)
- #cap_only
- #cap_only?
- #cap_only_inner
- #cap_value
- #consumed
- #each_reachable_defn(ctx : Context) : Array(ReifiedType)
- #each_reachable_defn_with_cap(ctx : Context) : Array(Tuple(ReifiedType, Capability))
- #each_type_alias_in_first_layer(&block : ReifiedTypeAlias -> _)
- #find_callable_func_defns(ctx : Context, name : String) : Set(Tuple(MetaType, ReifiedType | Nil, Program::Function | Nil))
- #gather_call_receiver_span(ctx : Context, pos : Source::Pos, infer : Visitor | Nil, name : String) : Span
- #inner : Inner
- #intersect(other : MetaType)
-
#is_partial_reify_of_type_param?(param : TypeParam) : Bool
A partial reify type param is a type param intersected with a capability.
- #is_sendable? : Bool
- #map_each_intersection_term_and_or_cap(&block : MetaType -> T) forall T
- #map_each_union_member(&block : MetaType -> T) forall T
- #negate
- #override_cap(name : String)
- #override_cap(meta_type : MetaType)
- #override_cap(cap : Capability)
- #override_cap(cap : Cap)
- #partial_reifications
-
#safe_to_match_as?(ctx : Context, other : MetaType) : Bool | Nil
Returns true if it is safe to refine the type of self to other at runtime.
-
#satisfies_bound?(ctx : Context, other : MetaType)
Return true if this MetaType is a satisfies the other MetaType as a type parameter bound/constraint.
- #show_type
- #simplify(ctx : Context) : MetaType
- #single!
- #single? : Nominal | Nil
- #single_rt?
- #single_rt_or_rta!
- #single_rt_or_rta?
- #singular?
- #stabilized
- #strip_cap
- #substitute_each_type_alias_in_first_layer(&block : ReifiedTypeAlias -> MetaType)
- #substitute_type_params_retaining_cap(type_params : Array(TypeParam), type_args : Array(MetaType)) : MetaType
-
#subtype_of?(ctx : Context, other : MetaType)
Return true if this MetaType is a subtype of the other MetaType.
- #type_param_only?
- #type_params : Set(TypeParam)
- #unconstrained?
- #unite(other : MetaType)
- #unsatisfiable?
- #viewed_from(origin : MetaType)
- #with_additional_type_arg!(arg : MetaType) : MetaType
- #within_constraints?(ctx : Context, types : Iterable(MetaType))
Constructor Detail
Class Method Detail
Instance Method Detail
A partial reify type param is a type param intersected with a capability.
Returns true if it is safe to refine the type of self to other at runtime. Returns false if doing so would violate capabilities. Returns nil if doing so would be impossible even if we ignored capabilities.
TODO This function isn't actually used by match types - it's only used for Pony runtime trace characteristics, and we're not fully sure it's correct. Needs auditing for correctness in that context, and potential renaming.
Return true if this MetaType is a satisfies the other MetaType as a type parameter bound/constraint.
Return true if this MetaType is a subtype of the other MetaType.