struct Savi::Compiler::Infer::MetaType

Defined in:

savi/compiler/infer/meta_type.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(defn : ReifiedType, cap : String | Nil = nil) #

[View source]
def self.new(defn : ReifiedType, cap : Cap) #

[View source]
def self.new(defn : ReifiedTypeAlias) #

[View source]

[View source]

Class Method Detail

def self.cap(name : String) #

[View source]
def self.cap(cap : Cap) #

[View source]
def self.new_alias(defn : ReifiedTypeAlias) #

[View source]
def self.new_intersection(types : Iterable(MetaType)) #

[View source]
def self.new_nominal(defn : ReifiedType) #

[View source]
def self.new_type_param(defn : TypeParam) #

[View source]
def self.new_union(types : Iterable(MetaType)) #

[View source]
def self.unconstrained #

[View source]
def self.unsatisfiable #

[View source]

Instance Method Detail

def &(other : MetaType) #

[View source]
def - #

[View source]
def |(other : MetaType) #

[View source]
def aliased #

[View source]
def any_callable_func_defn_type(ctx, name : String) : ReifiedType | Nil #

[View source]
def any_type_alias_in_first_layer? #

[View source]
def cap(name : String) #

[View source]
def cap(cap : Cap) #

[View source]
def cap_only #

[View source]
def cap_only? #

[View source]
def cap_only_inner #

[View source]
def cap_value #

[View source]
def consumed #

[View source]
def each_reachable_defn(ctx : Context) : Array(ReifiedType) #

[View source]
def each_reachable_defn_with_cap(ctx : Context) : Array(Tuple(ReifiedType, Capability)) #

[View source]
def each_type_alias_in_first_layer(&block : ReifiedTypeAlias -> _) #

[View source]
def find_callable_func_defns(ctx : Context, name : String) : Set(Tuple(MetaType, ReifiedType | Nil, Program::Function | Nil)) #

[View source]
def gather_call_receiver_span(ctx : Context, pos : Source::Pos, infer : Visitor | Nil, name : String) : Span #

[View source]
def inner : Inner #

[View source]
def intersect(other : MetaType) #

[View source]
def is_partial_reify_of_type_param?(param : TypeParam) : Bool #

A partial reify type param is a type param intersected with a capability.


[View source]
def is_sendable? : Bool #

[View source]
def map_each_intersection_term_and_or_cap(&block : MetaType -> T) forall T #

[View source]
def map_each_union_member(&block : MetaType -> T) forall T #

[View source]
def negate #

[View source]
def override_cap(name : String) #

[View source]
def override_cap(meta_type : MetaType) #

[View source]
def override_cap(cap : Capability) #

[View source]
def override_cap(cap : Cap) #

[View source]
def partial_reifications #

[View source]
def 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. 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.


[View source]
def satisfies_bound?(ctx : Context, other : MetaType) #

Return true if this MetaType is a satisfies the other MetaType as a type parameter bound/constraint.


[View source]
def show_type #

[View source]
def simplify(ctx : Context) : MetaType #

[View source]
def single! #

[View source]
def single? : Nominal | Nil #

[View source]
def single_rt? #

[View source]
def single_rt_or_rta! #

[View source]
def single_rt_or_rta? #

[View source]
def singular? #

[View source]
def stabilized #

[View source]
def strip_cap #

[View source]
def substitute_each_type_alias_in_first_layer(&block : ReifiedTypeAlias -> MetaType) #

[View source]
def substitute_type_params_retaining_cap(type_params : Array(TypeParam), type_args : Array(MetaType)) : MetaType #

[View source]
def subtype_of?(ctx : Context, other : MetaType) #

Return true if this MetaType is a subtype of the other MetaType.


[View source]
def type_param_only? #

[View source]
def type_params : Set(TypeParam) #

[View source]
def unconstrained? #

[View source]
def unite(other : MetaType) #

[View source]
def unsatisfiable? #

[View source]
def viewed_from(origin : MetaType) #

[View source]
def with_additional_type_arg!(arg : MetaType) : MetaType #

[View source]
def within_constraints?(ctx : Context, types : Iterable(MetaType)) #

[View source]