Skip to content

javaMethodName

The visible Java method name for the given KaFunctionSymbol. The behavior is unspecified for modules other than the JVM.

The endpoint supports:

The name is null when the symbol has no method that can be referenced from Java:

  • KaConstructorSymbol: constructors are neither renamed by JvmName nor mangled, so there is no name to compute

  • KaSamConstructorSymbol and KaAnonymousFunctionSymbol: there is no addressable JVM method

  • KaSymbolLocation.LOCAL declarations: their JVM names are invented during lowering and cannot be reconstructed from a symbol

  • Property accessors of a property without a name, of a const property, or of a property with a JvmField backing field, as no accessor method is generated in these cases

  • The computed name is not a valid Java identifier, such as for an escaped Kotlin name like a b c, as such a method cannot be referenced from Java code

  • The name is mangled because of value classes: the suffix is either a hash of the signature, as in classFunInParameter-5lyY9Q4, or impl for a member of a value class, as in funWithoutParameters-impl, and the endpoint computes neither