Join Slack
Does anyone know where I can see the source for the primitive types such as `Int`? I’m interested in...
# compiler
a
Adam
08/28/2020, 3:15 AM
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
udalov
08/28/2020, 10:51 AM
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
Adam
08/28/2020, 3:04 PM
I see, thanks!
4
Views
Open in Slack
Previous
Next
kotlinlang
A modern programming language that makes developers happier.
Powered by