Class: TypedRb::Types::TyDynamicFunction

Inherits:
TyFunction show all
Defined in:
lib/typed/types/ty_dynamic.rb

Instance Attribute Summary

Attributes inherited from TyFunction

#arity, #block_type, #from, #min_arity, #name, #parameters_info, #to

Attributes inherited from Type

#node

Instance Method Summary collapse

Methods inherited from TyFunction

#<=>, #apply_bindings, #deconstruct_from_arguments, #generic?, #to_s, #with_block_type

Methods included from Comparable

#<=>

Methods inherited from Type

#either?, #stack_jump?

Constructor Details

#initialize(klass, message, with_block = true, node = nil) ⇒ TyDynamicFunction

Returns a new instance of TyDynamicFunction.



16
17
18
19
20
21
22
# File 'lib/typed/types/ty_dynamic.rb', line 16

def initialize(klass, message, with_block = true, node = nil)
  super([], TyDynamic.new(Object, node), nil, node)
  @klass = klass
  @message = message
  @arity = Float::INFINITY
  @block_type = TyDynamicFunction.new(Proc, :cal, false) if with_block
end

Instance Method Details

#arg_compatible?(_) ⇒ Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/typed/types/ty_dynamic.rb', line 28

def arg_compatible?(_)
  true
end

#check_args_applicationObject



32
# File 'lib/typed/types/ty_dynamic.rb', line 32

def check_args_application; end

#compatible?(_other_type, _relation = :lt) ⇒ Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/typed/types/ty_dynamic.rb', line 34

def compatible?(_other_type, _relation = :lt)
  true
end

#dynamic?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/typed/types/ty_dynamic.rb', line 24

def dynamic?
  true
end