I was noticing a wierd issue in the toString metho...
# announcements
a
I was noticing a wierd issue in the toString method of `inline classes`: Given this piece of code:
Copy code
fun main(args: Array<String>) {
    val wi = WrapInt(1)
    val ws = WrapString("1")
    println(wi)
    println(ws)
}

inline class WrapInt(private val x: Int)
inline class WrapString(private val x: String)
In 1.3-M2 the the toString method was changed to a structure of a
data class
but when calling it on a class that wraps a string it just prints out the contained string... (In JVM)
Copy code
WrapInt(x=1)
1
In Kotlin Native though it works as expected... giving this output:
Copy code
WrapInt(x=1)
WrapString(x=1)
Copy code
@NotNull
   public static String toString(String var0) {
      return "WrapString(x=" + var0 + ")";
   }
This is from the generated bytecode (decompiled)
It works when calling
toString
explicitly