dynamic type fails sourcegenerator CS8785 'MessagePackGenerator' failed to generate source.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 25/100
Hướng nghiên cứu
Start with the MessagePack source generator and analyzer named in the errors, then trace how they handle the reproduced dynamic field in AnObject. The issue provides no file or test path, so first locate the generator tests for unsupported member types. Done means this case no longer throws during generation and compilation has no generator errors; pull request #2319 is already open.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Bug description
dynamictype in PackObject fails sourcegenerator
Repro steps
[MessagePackObject(keyAsPropertyName: true)]
public class AnObject
{
public dynamic value;
}
Expected behavior
No messages
Actual behavior
CSC : error CS8785: Generator 'MessagePackGenerator' failed to generate source. It will not contribute to the output and compilation errors may occur as a result. Exception was of type 'NotSupportedException' with message 'Specified method is not supported.'.
CSC : error AD0001: Analyzer 'MessagePack.SourceGenerator.Analyzers.MsgPack00xMessagePackAnalyzer' threw an exception of type 'System.NotSupportedException' with message 'Specified method is not supported.'.
(Using WarningsAsErrors)
- Version used: 3.1.12
- Runtime: (e.g. .NET Framework, .NET Core, Unity, mono, etc.): netstandard2.0
Additional context
Similar issues, but different types, so worth a separate issue to track this one.
When this happens it would be nice to have the error include which method is not supported, and maybe also have an attribute that IgnoreSourceGenerationIfUnknownAndIfAlreadyReportedUpstream
- Ngôn ngữ chính
- C#
- Star
- 6.8k
- Fork
- 783
- Merge trung bình
- 19 giờ 47 phút
- Pull request đã merge (30 ngày)
- 3
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
- Không 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 MessagePack-CSharp/MessagePack-CSharp
-
SerializableMemberTypeAnalyzer throws AD0001 when any referenced assembly has an assembly-level attribute with a single array argumentCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
MessagePack-CSharp/MessagePack-CSharp#2324 · 1 bình luận ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 76/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
MessagePack-CSharp/MessagePack-CSharp#2276 · 2 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
MessagePack-CSharp/MessagePack-CSharp#2252 · 3 bình luận ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 10/100
MessagePack-CSharp/MessagePack-CSharp#2316 · 14 reaction ·
Tất cả issue của MessagePack-CSharp/MessagePack-CSharp
Issue tương tự
-
type:task ux
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
elsa-workflows/elsa-foundation#5253 ·
Maintainer thường phản hồi trong vòng 1 ngày