Class: Mirah::JVM::Types::JavaFieldSetter
- Inherits:
-
JavaFieldAccessor
- Object
- JavaCallable
- JavaConstructor
- JavaMethod
- JavaFieldAccessor
- Mirah::JVM::Types::JavaFieldSetter
- Defined in:
- lib/mirah/jvm/types/methods.rb
Instance Attribute Summary
Attributes inherited from JavaCallable
Instance Method Summary collapse
Methods inherited from JavaFieldAccessor
Methods inherited from JavaMethod
#abstract?, #call_special, #constructor?, #static?, #void?
Methods inherited from JavaConstructor
#constructor?, #declaring_class, #exceptions
Methods inherited from JavaCallable
#field?, #initialize, #name, #parameter_types
Methods included from ArgumentConversion
Constructor Details
This class inherits a constructor from Mirah::JVM::Types::JavaCallable
Instance Method Details
#argument_types ⇒ Object
345 346 347 |
# File 'lib/mirah/jvm/types/methods.rb', line 345 def argument_types [AST.type(nil, @member.type)] end |
#call(compiler, ast, expression) ⇒ Object
349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 |
# File 'lib/mirah/jvm/types/methods.rb', line 349 def call(compiler, ast, expression) target = ast.target.inferred_type # TODO: assert that no args are being passed, though that should have failed lookup if @member.static? convert_args(compiler, ast.parameters) compiler.method.dup if expression compiler.method.putstatic(target, name, @member.type) else ast.target.compile(compiler, true) convert_args(compiler, ast.parameters) compiler.method.dup_x2 if expression compiler.method.putfield(target, name, @member.type) end end |