<https://twitter.com/dh44t/status/9302769523589120...
# random
n
What is the performance overhead of using typealias?
a
@napperley none, the typealias does not exist at runtime. is replaced by the actual type at compile-time
n
So in effect there is a form of inlining going on.
a
@napperley yes,
typealias MyDouble = Double
the compiler will replace all occurences of
MyDouble
with
Double
. Be aware, that when you have a parameter with the type
MyDouble
, you can pass a
Double
,
c
i'm looking forward to the day when kotlin supports non type compatible typealiases, would be a huge win for e.g. ids
d
I think that there is some proposal for value classes, it should cover that case