Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

155
Views
¿El código de bytes generado por Kotlin afecta el recuento de métodos?

Por ejemplo, si uso

 methodReference = ::method

en vez de

 methodReference = { method(it) }

El código descompilado contendrá getOwner , getName , getSignature en código Java, debido a la reflexión. ¿Estos métodos cuentan contra el límite de 64k?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Los métodos se cuentan, solo si no son eliminados por proguard/R8

Un ejemplo

 fun method(t : Any) {} val reference1: KFunction1<Any, Unit> = ::method val reference2: (Any) -> Unit = { method(it) }

Para la reference1 , el código de bytes (descompilado a Java) sería:

 @NotNull final KFunction reference1 = new Function1((X)this) { // $FF: synthetic method // $FF: bridge method public Object invoke(Object var1) {.. } public final void invoke(@NotNull Object p1) {..} public final KDeclarationContainer getOwner() {..} public final String getName() {..} public final String getSignature() {..} };

para el lambda (o referencia2) el código java equivalente es:

 @NotNull final Function1 reference2 = (Function1)(new Function1() { // $FF: synthetic method // $FF: bridge method public Object invoke(Object var1) {..} public final void invoke(@NotNull Object it) {..} });

Entonces, la diferencia es 4 +1 para la referencia del método y 1 +1 para lambda, donde +1 proviene de la invoke(t:Any)

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!