Skip to content

Kotlin Class name starts with $ has an incorrect Metadata #1363

@fan87

Description

@fan87

I haven't started parsing metadata yet, but I have placed some breakpoints inside Kotlin reflection, and it seemed like $ were replaced by . in the deserialized class metadata.

Version: 1.11-SNAPSHOT

Steps to Reproduce

  1. Main.kt
fun main() {
    val c = `$ExampleClass`::class
    println(c.nestedClasses.joinToString(","))
}
object `$ExampleClass` {
    class Nested
}
  1. Remap -> Shadow the remapped jar (reflect is required to be shaded into)

  2. Run the jar java -cp loom-remap-issue-1.0-SNAPSHOT.jar MainKt

Expected Behavior

This is the expected result from the snippet provided above (without Fabric Loom remapping the Jar):
Image

With Fabric Loom Remapping:
Image

Notes

I can't and won't share why I needed $ to be the first character of the class name. It's because of a library we are using.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions