https://kotlinlang.org logo
#getting-started
Title
# getting-started
m

mgrazianodecastro

02/17/2023, 1:58 PM
does
const val
inside
object
is known to have cache problems with builds? I'm having some with them, where defining them once seems to create some difficulties to alter (some string, for example) later. Or is it some android studio problem (and not a kotlin one)?
c

CLOVIS

02/17/2023, 2:06 PM
const
means the value is inlined on all callsite. If you edit the value, all downstream projects have to be recompiled to use it.
🤔 1
If the
const val
is
private
or
internal
it shouldn't, but I haven't checked
m

mgrazianodecastro

02/17/2023, 2:09 PM
In theory, I am recompiling it (I guess rebuilding the project counts as recompiling it). But I'm gonna double check it next time. And yes, it is a private field
c

CLOVIS

02/17/2023, 2:10 PM
If it's private, I think this should be raised to the Kotlin team 🤔
m

mgrazianodecastro

02/17/2023, 2:12 PM
I see, I'm gonna send them the issue next time it happens. I'm on the pain of cleaning up my gradle folders
4 Views