Enigma icon indicating copy to clipboard operation
Enigma copied to clipboard

TinyMappingsWriter skips nested class with same name

Open Marcono1234 opened this issue 6 years ago • 2 comments

https://github.com/FabricMC/Enigma/blob/6a7192e18336e933f77d2e16f8f0e8eb114949e3/src/main/java/cuchaz/enigma/translation/mapping/serde/TinyMappingsWriter.java#L75

If a nested class is mapped to the same name, no mapping entry is written, e.g.:

MyClass -> a:
MyClass$1 -> a$1:

becomes

v1	intermediary	named
CLASS	a	MyClass

In theory (I think) a$1 could be a class completely unrelated to a, so there is no way to tell from the Tiny mappings what a$1 should be mapped to.

Marcono1234 avatar Oct 31 '19 21:10 Marcono1234

hmm, the resolution is to add all inner class info to enigma mappings despite that these classes have no mappings.

liach avatar Oct 31 '19 22:10 liach

Their parent is mapped though. And assuming a$1 is an inner class of a could be wrong.

It appears the tiny mappings produced by yarn contain these mappings. And, unless I have configured it incorrectly, tiny-remapper is not remapping these classes since they don't have a mapping.

Marcono1234 avatar Oct 31 '19 22:10 Marcono1234