C# -> VB: Expected VB code is invalid in the test Conflict_DeclarationsAfterConvertionForToWhileAsync
还没有人认领这个 Issue。
评估
调研方向
从 Tests/VB/StatementTests.cs 中的 Conflict_DeclarationsAfterConvertionForToWhileAsync 开始,该位置大约在第 896 行,并运行该测试以重现无效的 VB 输出。跟踪 C# for-loop 转换,并将其与 issue 中的预期输出进行比较。当测试生成具有独立循环作用域和预期 For-loop 形式的有效 VB 时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
Input code
class TestClass {
double height;
void TestMethod() {
for(double y = 0d; y < height; y += 10d)
Draw(y);
for(double y = 0d; y < height; y += 20d)
Draw(y);
}
void Draw(double height) {
}
}
Erroneous output
Friend Class TestClass
Private height As Double
Private Sub TestMethod()
Dim y As Double = 0R
While y < height
Me.Draw(y)
y += 10R
End While
Dim y As Double = 0R
While y < height
Me.Draw(y)
y += 20R
End While
End Sub
Private Sub Draw(ByVal height As Double)
End Sub
End Class
Expected output
Friend Class TestClass
Private height As Double
Private Sub TestMethod()
For y As Double = 0R To height - 1 Step 10R
Draw(y)
Next
For y As Double = 0R To height - 1 Step 20R
Draw(y)
Next
End Sub
Private Sub Draw(height As Double)
End Sub
End Class
Details
In Conflict_DeclarationsAfterConvertionForToWhileAsync test method starting on line 896.
https://github.com/icsharpcode/CodeConverter/blob/master/Tests/VB/StatementTests.cs
The error is the variable y is declared twice in the method.
Not sure why a C# for loop is being converted to a VB while loop.
- 主要语言
- C#
- 星标
- 914
- 派生
- 242
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
icsharpcode/CodeConverter 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
icsharpcode/CodeConverter#1271 · 1 条评论 ·
-
C# -> VB: most pattern matching fails to convert可能已有人在做 @gherards99 于 36 天前认领。 未关闭C# -> VB
难度 4/5 3-5 天 新手友好度 35/100
icsharpcode/CodeConverter#1281 ·
-
难度 3/5 1-2 天 新手友好度 55/100
icsharpcode/CodeConverter#1275 ·
-
VB -> C#: Handleres of sub properties being untracked可能已有人在做 @Igor-Tomasi 于 72 天前认领。 未关闭VB -> C#
难度 3/5 1-2 天 新手友好度 62/100
icsharpcode/CodeConverter#1273 ·
-
VB -> C#: "Group By Into" Linq queries supressing aggregations ("Into" part) in the converted code未关闭Difficult area VB -> C#
难度 3/5 1-2 天 新手友好度 74/100
icsharpcode/CodeConverter#1272 ·
查看 icsharpcode/CodeConverter 的全部 Issue
相似的 Issue
-
area:jobads-cv BE mvp P2
难度 2/5 1-3 小时 新手友好度 62/100
klasolsson81/jobbliggaren#2099 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
0 - Backlog Bug
难度 2/5 1-3 小时 新手友好度 62/100
BrighterCommand/Brighter#4581 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 92/100
Esri/calcite-dotnet-toolkit#30 · 1 个 reaction ·
-
kind:docs simplification size:S status:todo
难度 2/5 1-3 小时 新手友好度 82/100
elsa-workflows/elsa-foundation#2604 ·
维护者通常 1 天内回复