VB -> C#: Async modifier incorrectly retained on abstract method declarations
Maintainer thường phản hồi trong vòng 3 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 62/100
Hướng nghiên cứu
The payload names no files, so begin by reproducing the snippet in the converter and searching the VB-to-C# path for where method modifiers such as Async, MustOverride and Overrides are translated. The fix should suppress async when the converted method has no body while preserving it on implementations, and add a regression test covering both the abstract and overriding declaration. Done means the abstract method emits public abstract Task TestMethod(); and the override still uses async.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
VB.Net input code
Imports System.Threading.Tasks
MustInherit Class TestClass
Public MustOverride Async Function TestMethod() As Task
End Class
Class ChildClass
Inherits TestClass
Public Overrides Async Function TestMethod() As Task
Await Task.Delay(1)
End Function
End Class
Erroneous output
using System.Threading.Tasks;
internal abstract partial class TestClass
{
public abstract async Task TestMethod();
}
internal partial class ChildClass : TestClass
{
public override async Task TestMethod()
{
await Task.Delay(1);
}
}
The abstract declaration produces:
CS1994: The 'async' modifier can only be used in methods that have a body.
Expected output
using System.Threading.Tasks;
internal abstract partial class TestClass
{
public abstract Task TestMethod();
}
internal partial class ChildClass : TestClass
{
public override async Task TestMethod()
{
await Task.Delay(1);
}
}
Details
- Product in use: VS extension, built locally from master.
- Version in use: 10.0.1, local development build.
- Did you see it working in a previous version, which? No.
- The converter retains the VB
Asyncmodifier on a bodylessMustOverridedeclaration, producing invalid C#. - Bodyless declarations should omit
async, while methods with an implementation should retain it. TheTaskreturn type is preserved in both cases.
- Ngôn ngữ chính
- C#
- Star
- 917
- Fork
- 243
- Merge trung bình
- 2 ngày 15 giờ
- Pull request đã merge (30 ngày)
- 9
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của icsharpcode/CodeConverter
-
VB -> C#
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
icsharpcode/CodeConverter#1301 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
icsharpcode/CodeConverter#1271 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
VB -> C#: Generic extension method inference widens element types when using a base-type comparerĐang mởVB -> C#
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
icsharpcode/CodeConverter#1302 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
VB -> C#
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
icsharpcode/CodeConverter#1300 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
VB -> C#
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 62/100
icsharpcode/CodeConverter#1298 ·
Maintainer thường phản hồi trong vòng 3 ngày
Tất cả issue của icsharpcode/CodeConverter
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 80/100
Unity-Technologies/unity-agent-plugin#118 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
The Recommended preset turns on Import Uno DSP, which only works with the Material themeCó thể đã có người làm @agneszitte đã nhận hôm nay. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
unoplatform/uno.templates#2388 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
eyalgolan/statecraft-israel#2732 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
変換の候補のどれが Zenzai の答えか分からないĐang mở要トリアージ
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
Maintainer thường phản hồi trong vòng 1 ngày
-
kind/chore status/draft
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Altinn/altinn-events#1158 ·
Maintainer thường phản hồi trong vòng 1 ngày