https://kotlinlang.org logo
m

Marc Knaup

12/06/2018, 12:21 AM
Copy code
/**
 * JVM internal name of the class, where package names are separated by '/', and class names are separated by '$',
 * for example: `"org/foo/bar/Baz$Nested"`
 */
val ClassName.jvmInternalName: String
    get() =
        if (this.isLocal) substring(1)
        else replace('/', '$')
Isn't it supposed to replace
.
with
$
, not
/
with
$
?
g

gildor

12/06/2018, 2:22 AM
On bytecode level jvm uses
/
, not
.
like in source code. You can open any bytecode and check
java.lang.String
becomes
java/lang/String
i

ilya.gorbunov

12/06/2018, 3:18 PM
@Marc Knaup seems so. Could you please report a bug?
m

Marc Knaup

12/06/2018, 5:50 PM
5 Views