class RBS::Types::UntypedFunction
Attributes
return_type[R]
Public Class Methods
new(return_type:)
click to toggle source
# File rbs-3.7.0/lib/rbs/types.rb, line 1215 def initialize(return_type:) @return_type = return_type end
Public Instance Methods
==(other)
click to toggle source
# File rbs-3.7.0/lib/rbs/types.rb, line 1295 def ==(other) other.is_a?(UntypedFunction) && other.return_type == return_type end
Also aliased as: eql?
each_param(&block)
click to toggle source
# File rbs-3.7.0/lib/rbs/types.rb, line 1245 def each_param(&block) if block # noop else enum_for :each_param end end
each_type() { |return_type| ... }
click to toggle source
# File rbs-3.7.0/lib/rbs/types.rb, line 1237 def each_type(&block) if block yield return_type else enum_for :each_type end end
empty?()
click to toggle source
# File rbs-3.7.0/lib/rbs/types.rb, line 1271 def empty? true end
free_variables(acc = Set.new)
click to toggle source
# File rbs-3.7.0/lib/rbs/types.rb, line 1219 def free_variables(acc = Set.new) return_type.free_variables(acc) end
has_classish_type?()
click to toggle source
# File rbs-3.7.0/lib/rbs/types.rb, line 1279 def has_classish_type? return_type.has_classish_type? end
has_self_type?()
click to toggle source
# File rbs-3.7.0/lib/rbs/types.rb, line 1275 def has_self_type? return_type.has_self_type? end
hash()
click to toggle source
# File rbs-3.7.0/lib/rbs/types.rb, line 1301 def hash self.class.hash ^ return_type.hash end
map_type() { |return_type| ... }
click to toggle source
# File rbs-3.7.0/lib/rbs/types.rb, line 1223 def map_type(&block) if block update(return_type: yield(return_type)) else enum_for :map_type end end
map_type_name(&block)
click to toggle source
# File rbs-3.7.0/lib/rbs/types.rb, line 1231 def map_type_name(&block) UntypedFunction.new( return_type: return_type.map_type_name(&block) ) end
param_to_s()
click to toggle source
# File rbs-3.7.0/lib/rbs/types.rb, line 1287 def param_to_s "?" end
return_to_s()
click to toggle source
# File rbs-3.7.0/lib/rbs/types.rb, line 1291 def return_to_s return_type.to_s(1) end
sub(subst)
click to toggle source
# File rbs-3.7.0/lib/rbs/types.rb, line 1259 def sub(subst) map_type { _1.sub(subst) } end
to_json(state = _ = nil)
click to toggle source
# File rbs-3.7.0/lib/rbs/types.rb, line 1253 def to_json(state = _ = nil) { return_type: return_type }.to_json(state) end
update(return_type: self.return_type)
click to toggle source
# File rbs-3.7.0/lib/rbs/types.rb, line 1267 def update(return_type: self.return_type) UntypedFunction.new(return_type: return_type) end
with_nonreturn_void?()
click to toggle source
# File rbs-3.7.0/lib/rbs/types.rb, line 1283 def with_nonreturn_void? false end
with_return_type(ty)
click to toggle source
# File rbs-3.7.0/lib/rbs/types.rb, line 1263 def with_return_type(ty) update(return_type: ty) end