Regex sourcegen fails with CS0759 when member inside file scoped class
Maintainer thường phản hồi trong vòng 1 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
- 45/100
Hướng nghiên cứu
The payload gives a reproduction using the GeneratedRegex attribute on a partial method inside a static file partial class, which produces CS0759. Start by reproducing it with that snippet and finding where the regex source generator emits the partial method implementation. Done means a clearer diagnostic for file-scoped containing types, or a documented limitation, with a test covering the case.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description
like for #57880 the regex source generator errors out with "No defining declaration found for implementing declaration of partial method", which is technically right, just that maybe a more to the point error message could help finding out that this can't work with a file scoped class
Reproduction Steps
static file partial class sfpc
{
[GeneratedRegex("[^a-zA-Z0-9\\.\\-_]", RegexOptions.Compiled | RegexOptions.ECMAScript)]
private static partial Regex GetSanitizeRx();
}
Expected behavior
warn user about file scoped class
Actual behavior
error CS0759
Regression?
i don't think so, it's the same on net7 and net10
Known Workarounds
No response
Configuration
windows up to date, vs up to date, x64
Other information
No response
- Ngôn ngữ chính
- C#
- Star
- 18.4k
- Fork
- 5.8k
- Merge trung bình
- 2 ngày 13 giờ
- Pull request đã merge (30 ngày)
- 588
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- 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 dotnet/runtime
-
area-System.IO untriaged
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 72/100
dotnet/runtime#136802 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[wasi] .NET 10: WasmEnableSIMD with AOT fails because WasiApp.targets has -msimd128 commented outĐang mởarea-Build-mono untriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area-System.ComponentModel untriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
dotnet/runtime#136608 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
MemoryMappedFile (Windows): failed MEM_COMMIT is ignored, accessor over reserved memory crashes the processCó thể đã có người làm @RutulPatel8 đã nhận 1 ngày trước. Đang mởarea-System.IO bug untriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
dotnet/runtime#136599 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area-System.IO untriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
dotnet/runtime#136577 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của dotnet/runtime
Issue tương tự
-
is:build
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
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 82/100
nopSolutions/nopCommerce#8440 ·
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 62/100
RadicalCSG/com.chisel#192 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area-testing p2-post-1.0 technical-debt
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Bug good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
RazorConsole/RazorConsole#447 ·
Maintainer thường phản hồi trong vòng 1 ngày