Class: Mirah::JVM::Types::JavaStaticMethod
- Inherits:
-
JavaMethod
- Object
- JavaCallable
- JavaConstructor
- JavaMethod
- Mirah::JVM::Types::JavaStaticMethod
- Defined in:
- lib/mirah/jvm/types/methods.rb
Instance Attribute Summary
Attributes inherited from JavaCallable
Instance Method Summary collapse
- #accept(visitor, expression) ⇒ Object
- #call(compiler, ast, expression, parameters = nil) ⇒ Object
- #kind ⇒ Object
Methods inherited from JavaMethod
#abstract?, #call_special, #constructor?, #return_type, #static?, #type_parameters, #void?
Methods inherited from JavaConstructor
#argument_types, #constructor?, #declaring_class, #exceptions, #isVararg, #return_type, #type_parameters, #varargs?
Methods inherited from JavaCallable
#field?, #initialize, #name, #parameter_types, #synthetic?
Methods included from ArgumentConversion
Constructor Details
This class inherits a constructor from Mirah::JVM::Types::JavaCallable
Instance Method Details
#accept(visitor, expression) ⇒ Object
381 382 383 |
# File 'lib/mirah/jvm/types/methods.rb', line 381 def accept(visitor, expression) visitor.visitStaticMethodCall(self, expression) end |
#call(compiler, ast, expression, parameters = nil) ⇒ Object
366 367 368 369 370 371 372 373 374 375 376 377 378 379 |
# File 'lib/mirah/jvm/types/methods.rb', line 366 def call(compiler, ast, expression, parameters=nil) target = declaring_class parameters ||= ast.parameters convert_args(compiler, parameters) compiler.method.invokestatic( target, name, [@member.return_type, *@member.argument_types]) # if expression, void static methods return null, for consistency # TODO: inference phase needs to track that signature is void # but actual type is null object compiler.method.aconst_null if expression && void? return_type.pop(compiler.method) unless expression || void? end |
#kind ⇒ Object
385 386 387 |
# File 'lib/mirah/jvm/types/methods.rb', line 385 def kind Java::OrgMirahJvmTypes::MemberKind::STATIC_METHOD end |