class Myst::TypeCheck::UnionType
- Myst::TypeCheck::UnionType
- Myst::TypeCheck::Type
- Reference
- Object
Defined in:
typecheck/type.crConstructors
-
.new(types : Array(Type))
Union types are immutable.
Instance Method Summary
-
#==(other : self)
Returns
true
if this reference is the same as other. - #exclude(other : UnionType)
-
#exclude(other : Type)
Excluding a type from a singular type is non-sensical, and should never happen.
-
#hash(hasher)
See
Object#hash(hasher)
- #includes?(other : UnionType)
- #includes?(other : Type)
- #types : Set(Type)
- #types=(types : Set(Type))
- #union_with(other : UnionType)
- #union_with(other : Type)
Instance methods inherited from class Myst::TypeCheck::Type
==(other : self)
==,
ancestors
ancestors,
exclude(other : Type)
exclude,
hash(hasher)
hash,
id : UInt64
id,
id=(id : UInt64)
id=,
includes?(other : Type)
includes?,
instance_type
instance_type,
instance_type=(instance_type : Type | Nil)
instance_type=,
instance_type? : Type | Nil | Nil
instance_type?,
instantiable?
instantiable?,
name : String
name,
name=(name : String)
name=,
scope : Scope
scope,
scope=(scope : Scope)
scope=,
static_type
static_type,
static_type=(static_type : Type | Nil)
static_type=,
static_type? : Type | Nil | Nil
static_type?,
super_type : Type | Nil
super_type,
super_type=(super_type : Type | Nil)
super_type=,
super_type? : Type | Nil | Nil
super_type?,
to_s(io : IO)
to_s,
union_with(other : Type)union_with(other : UnionType) union_with
Constructor methods inherited from class Myst::TypeCheck::Type
new(name : String, id : UInt64 = @@next_id, *, static_type : Myst::TypeCheck::Type | Nil = nil, instance_type : Myst::TypeCheck::Type | Nil = nil, super_type : Myst::TypeCheck::Type | Nil = nil)
new
Constructor Detail
Union types are immutable. Adding a new type to a union creates an entirely new Union.
Instance Method Detail
def ==(other : self)
#
Description copied from class Reference
Returns true
if this reference is the same as other. Invokes same?
.
Description copied from class Myst::TypeCheck::Type
Excluding a type from a singular type is non-sensical, and should never happen. However, it needs to be supported on all Types for consistency.