Module: Duby::JVM::Types::ArgumentConversion

Included in:
Intrinsic, JavaCallable
Defined in:
lib/duby/jvm/types/methods.rb

Instance Method Summary collapse

Instance Method Details

#convert_args(compiler, values, types = nil) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
# File 'lib/duby/jvm/types/methods.rb', line 17

def convert_args(compiler, values, types=nil)
  # TODO boxing/unboxing
  # TODO varargs
  types ||= argument_types
  values.zip(types).each do |value, type|
    value.compile(compiler, true)
    if type.primitive? && type != value.inferred_type
        value.inferred_type.widen(compiler.method, type)
    end
  end
end