Does anyone know where I can see the source for th...
# compiler
a
Does anyone know where I can see the source for the primitive types such as
Int
? I’m interested in seeing how mapping to
int
, and boxing to
java.lang.Integer
is implemented. So far I found a Generator class: https://github.com/JetBrains/kotlin/blob/master/generators/builtins/primitives.kt And this native generated file, but I can’t see an equivalent for JVM or where the conversion is handled. Thread in Slack Conversation
u
Primitive types are basically all over the compiler code, so it’s difficult to select a specific point. The closest I can think of is this method in the JVM backend which does all the boxing/unboxing: https://github.com/JetBrains/kotlin/blob/9097d0918c8c01c162ca4483599fdf13a0352cc1/compiler/backend/src/org/jetbrains/kotlin/codegen/StackValue.java#L630
👍 1
a
I see, thanks!