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

Parameter names in overridden methods don't propagate sometimes #42

Open
jaskarth opened this issue Dec 22, 2020 · 1 comment
Open

Parameter names in overridden methods don't propagate sometimes #42

jaskarth opened this issue Dec 22, 2020 · 1 comment

Comments

@jaskarth
Copy link

The parameter names of overriden methods don't have any names, even when the mappings say that they should. For example, the BlockPos constructor is

public BlockPos(int i, int j, int k) {
      super(i, j, k);
}

when it should be x, y, z. The mappings are correct when viewing with enigma. As another example, the abstract method in Carver is this public abstract boolean carve(Chunk chunk, Function<BlockPos, Biome> posToBiome, Random random, int seaLevel, int chunkX, int chunkZ, int mainChunkX, int mainChunkZ, BitSet carvingMask, C carverConfig); while the overriden method in CaveCarver is public boolean carve(Chunk chunk, Function<BlockPos, Biome> function, Random random, int i, int j, int k, int l, int m, BitSet bitSet, ProbabilityConfig probabilityConfig) {. It doesn't have any mappings when it should, as seen in enigma.

The strange thing about this issue is that it only happens to some methods, but not all of them. I would really appreciate this issue being fixed as it would make viewing the source much easier 😅

@sfPlayer1
Copy link
Collaborator

For <init> there's no virtual method dispatch, but chaining, thus I'd only want to do this if some special option is enabled (optimistically assume identical constructor signatures take the same named args). A proper solution would be determining the relationship by noticing the 1:1 pass-through to the super call, but this is matcher analysis level territory at least.

Other methods should be easy-ish. I want to change how TR holds mapping references (inside its model instead of the hash maps), which should then make it rather simple to resolve.

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