Class: Typisch::Type::Constructor::Singleton
Overview
A class of constructor type of which there is only one type, and hence only one tag.
Will have no supertype besides Any, and no subtype besides Nothing.
(abstract superclass; see Boolean or Null for example subclasses).
Constant Summary
CONSTRUCTOR_TYPE_SUBCLASSES
Instance Attribute Summary
#name
Class Method Summary
collapse
Instance Method Summary
collapse
#alternative_types, #check_type, inherited, #type_lattice
#<, #<=, #<=>, #==, #===, #>, #>=, #alternative_types, #annotations, #annotations=, #canonicalize!, #excluding_null, #inspect, #recursive?, #shallow_check_type, subtype?, #target, #to_string
Class Method Details
.check_subtype(x, y) ⇒ Object
94
95
96
|
# File 'lib/typisch/constructor.rb', line 94
def check_subtype(x, y)
true
end
|
86
87
88
|
# File 'lib/typisch/constructor.rb', line 86
def tag
raise NotImplementedError
end
|
90
91
92
|
# File 'lib/typisch/constructor.rb', line 90
def top_type(*)
@top_type ||= new
end
|
Instance Method Details
#subexpression_types ⇒ Object
99
100
101
|
# File 'lib/typisch/constructor.rb', line 99
def subexpression_types
[]
end
|
103
104
105
|
# File 'lib/typisch/constructor.rb', line 103
def tag
self.class.tag
end
|
107
108
109
|
# File 'lib/typisch/constructor.rb', line 107
def to_s(*)
@name.inspect
end
|