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

379
Views
Kotlin variable names: case sensitive?

Kotlin language spec claims identifiers are case-sensitive yet the following produces compiler error messages because of apparently case-insensitive generated getters/setters.

var a=10; var A=20

Clash.kt:1:1: error: platform declaration clash: The following declarations have the same JVM signature (getA()I):
    fun <get-A>(): Int defined in root package
    fun <get-a>(): Int defined in root package
var a=10
^

I understand what is happening but does this seem like the right behavior? Is there a way around this?

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

This has to do with how the compiler creates getters and setters to match the Java Beans standard. In this case, both of the getters and setters are named getA() and setA(...) because it tries to use the initial caps version of the field. If these fields were named aa and AA, however, you'd have getAa() and getAA() and wouldn't have a name collision.

over 4 years ago · Santiago Trujillo Report

0

An alternative workaround is to use @JvmField on one or both of the properties. This prevents Java getter and setter methods from being generated, so there are no clashing method signatures to worry about.

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!