Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Classes with a $ in sources have names and references unintentionally changed #31

Open
i509VCB opened this issue May 10, 2020 · 1 comment
Milestone

Comments

@i509VCB
Copy link

i509VCB commented May 10, 2020

So I discovered this while using mercury to update CraftFabric (https://github.com/tr7zw/CraftFabric) to the latest yarn mappings.

So one example class was class CraftScoreboard$2 implements Function<net.minecraft.scoreboard.Team, Team>

Now i agree this is definitely some very odd naming, but I'll continue. So I pushed the sources through mercury and the outputted result ends up as class 2 implements...

Furthermore some constructors were outputted incorrectly, such as the following:

CraftScoreboard$2(CraftScoreboard var1) {
    this.this$0 = var1;
}

where it becomes

(CraftScoreboard var1) {
    this.this$0 = var1;
}

Also some references were unintentionally changed, such as new CraftScoreboard$2(this) -> new 2(this)

@jamierocks
Copy link
Member

This was actually a known bug, and was actually the cause behind Sponge moving away from using the $ character in their class names.

The bug is caused by Lorenz treating the $ character as a delimeter for inner classes beyond just format implementation, which is to no consequence until you introduce source remapping into the ecosystem :(

At the time of Sponge's big remapping, I didn't really have the time to make any changes to Lorenz to resolve this - nor was I satisfied that any change wouldn't bring back the format implementations (and helpers) we had in Nocturne - with that said, I have a design in mind that could be used that could be used here.

@jamierocks jamierocks transferred this issue from CadixDev/Mercury Jun 7, 2020
@jamierocks jamierocks added this to the 0.7.0 milestone Jan 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants