class Myst::TypeCheck::Type
- Myst::TypeCheck::Type
- Reference
- Object
Direct Known Subclasses
Defined in:
typecheck/type.crConstructors
Instance Method Summary
-
#==(other : self)
Returns
true
if this reference is the same as other. - #ancestors
-
#exclude(other : Type)
Excluding a type from a singular type is non-sensical, and should never happen.
-
#hash(hasher)
See
Object#hash(hasher)
- #id : UInt64
- #id=(id : UInt64)
- #includes?(other : Type)
-
#instance_type
Likewise for instance types.
- #instance_type=(instance_type : Type | Nil)
- #instance_type? : Type | Nil | Nil
-
#instantiable?
A type is considered instantiable if it has an
#instance_type
. - #name : String
- #name=(name : String)
- #scope : Scope
- #scope=(scope : Scope)
-
#static_type
To avoid having to check if a type is static in the visitor, assume that static types won't have the
@static_type
relationship set, and returnself
in that case. - #static_type=(static_type : Type | Nil)
- #static_type? : Type | Nil | Nil
- #super_type : Type | Nil
- #super_type=(super_type : Type | Nil)
- #super_type? : Type | Nil | Nil
-
#to_s(io : IO)
Appends a short String representation of this object which includes its class name and its object address.
- #union_with(other : Type)
- #union_with(other : UnionType)
Constructor Detail
Instance Method Detail
Returns true
if this reference is the same as other. Invokes same?
.
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.
A type is considered instantiable if it has an #instance_type
. This is
the type that would be returned by an instantiation of this type.
To avoid having to check if a type is static in the visitor, assume
that static types won't have the @static_type
relationship set, and
return self
in that case.
Appends a short String representation of this object which includes its class name and its object address.
class Person
def initialize(@name : String, @age : Int32)
end
end
Person.new("John", 32).to_s # => #<Person:0x10a199f20>