Local variable names in inner class methods aren't fixed when they conflict with outer names
还没有人认领这个 Issue。
评估
调研方向
先从 FernFlower-Patches/0037-Do-not-rebuild-variable-names-in-lambdas.patch 的上下文入手,然后检查 VarNamesCollector.setNewOuterNames 和 getFreeName()。将当前行为与 issue 中描述的早期命名行为进行比较。当内部方法中的冲突局部名称能够得到正确处理,同时不破坏嵌套 scope 的行为时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
This is due to https://github.com/MinecraftForge/ForgeFlower/blob/master/FernFlower-Patches/0037-Do-not-rebuild-variable-names-in-lambdas.patch
For background on what that code is doing (re: the patch message):
That allows the decompiler to fix variable names in a nested class or lambda expression which clashes with the name of an outer variable.
What's happening is it's checking the names for the current method against the variable names defined in the outer scope. That's why setNewOuterNames is passed to VarNamesCollector, then checked for in VarNamesCollector.getFreeName() - the outer names are compared against the names for the nested method.
What FernFlower's code originally did was append x to local variable names when conflicts came up - but now it doesn't do that because of that patch. Considering that's the only thing that method is actually doing I don't know what the patch is actually trying to fix. The commit which added the patch said it fixes #88, but there is no issue 88 yet.
This comes up relatively infrequently, and I guess never in MCP due to how LVT is handled, but it causes an issue with my usage. This quick and dirty fix is because of this issue - previous versions of FernFlower would rename the inner i variable to ix. https://github.com/PaperMC/Paper/blob/mappings/mojang/Spigot-Server-Patches/0266-Optimize-BlockPosition-helper-methods.patch#L113-L134
- 主要语言
- 没有语言数据
- 星标
- 110
- 派生
- 49
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
我们还没有检查这个项目的环境配置文件。先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
MinecraftForge/ForgeFlower 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 42/100
MinecraftForge/ForgeFlower#131 ·
-
难度 4/5 3-5 天 新手友好度 25/100
MinecraftForge/ForgeFlower#85 · 3 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 45/100
-
难度 4/5 3-5 天 新手友好度 42/100
-
难度 4/5 3-5 天 新手友好度 30/100
MinecraftForge/ForgeFlower#76 · 1 条评论 · 3 个 reaction ·
查看 MinecraftForge/ForgeFlower 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 88/100
-
难度 2/5 1-3 小时 新手友好度 88/100
sveltejs/acorn-typescript#150 ·
-
area:stdlib found-by:code-review kind:silent-wrong
难度 2/5 1-3 小时 新手友好度 88/100
InauguralSystems/EigenScript#1338 ·
维护者通常 1 天内回复
-
better error message generics low priority
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100