Does `inline val` actually make a difference? ```i...
# stdlib
z
Does
inline val
actually make a difference?
Copy code
inline val ButWhy get() = "?"

val Difference get() = "?"
public final static getButWhy()Ljava/lang/String; @Lorg/jetbrains/annotations/NotNull;() // invisible L0 LDC 0 ISTORE 0 L1 LINENUMBER 13 L1 LDC "?" ARETURN L2 LOCALVARIABLE $i$f$getButWhy I L1 L2 0 MAXSTACK = 1 MAXLOCALS = 1 public final static getDifference()Ljava/lang/String; @Lorg/jetbrains/annotations/NotNull;() // invisible L0 LINENUMBER 15 L0 LDC "?" ARETURN L1 MAXSTACK = 1 MAXLOCALS = 0 (Clearly a difference, but I cant tell what that means in practice) 💡
c
IIRC the main difference is on the call-site, it shouldn't call the
inline get
👍🏽 1
☝️ 1
g
also with internal annotation @InlineOnly (used by stdlib) you will not have this method as part of bytecode at all, it will not be in resulting compilation
👍🏽 1