Inference status: ICSharpCode.Decompiler
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 15/100
Hướng nghiên cứu
Không có tệp, bài kiểm thử hoặc thay đổi cụ thể nào được nêu; issue này là báo cáo tiến độ của InferNull khi chạy với ICSharpCode.Decompiler. Hãy bắt đầu bằng việc xem xét các đường dẫn suy luận liên quan đến unconstrained generics, notnull constraints, các trường chưa được khởi tạo và cách Roslyn xử lý property setter. Hoàn thành không được định nghĩa ngoài việc giảm hoặc giải quyết các cảnh báo nullable-reference được liệt kê.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
The primary use-case (how I ended up starting this project) was trying to annotate ILSpy's decompiler engine, which quickly felt like a task that could be automated.
Timeline:
- March 2010 (yes, over 10 years ago): I had an idea for a null checking analysis as an analysis on IL code. I implemented some of that idea, but it didn't work well enough for my liking and I gave up on the idea. The original idea of the nullability constraint graph (back then I called it "nullability subtyping graph") is from back then. So is the idea of using the minimum cut for minimizing the number of warnings (back then: errors reported by the analysis tool).
- Early May 2020: I wanted to annotate ILSpy's decompiler engine (ICSharpCode.Decompiler) with nullable reference types. But it felt like a bunch of monotonous work that ought to be automated. I realized that the C# 8 nullable reference type system is somewhat similar to what I did 10 years earlier, and that my ideas may be applicable to an inference tool. An inference tool doesn't need to be perfect to be useful, it just needs automate the vast majority of the work.
- 2020-05-09: I started building the NullabilityInference prototype.
- 2020-05-17: The prototype can handle some individual code files from ICSharpCode.Decompiler.Utils
- 2020-06-08: The prototype finally supports enough language features to run over the whole ICSharpCode.Decompiler without crashing with a
NotImplementedException- Use .NET Core 3 + enable NRT, but not using inference --> 2714 warnings
- After running InferNull --> 1134 warnings.
- Some bugfixes reduce this to 1120 warnings.
- 2020-06-13: Implementing flow analysis (#5) gets us down to 1079 warnings.
- 2020-06-21:
[NotNullWhen(true)]-inference finally works correctly --> 722 warnings.
In the remaining warnings, I see some categories of problems occurring repeatedly:
- unconstrained generics: we can't infer
[AllowNullable]yet - generics: we can't infer
T: notnullconstraints yet - uninitialized fields: ILSpy has many classes where fields are initialized not in the constructor, but by other methods (e.g. a single public method serves as an entry point for a class and initializes a bunch of fields; with private methods relying on the fields already being initialized)
- Roslyn doesn't realize that fields are initialized when the ctor calls a property setter
- Ngôn ngữ chính
- C#
- Star
- 38
- Fork
- 6
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
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/NullabilityInference
-
Distribute as dotnet toolĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
icsharpcode/NullabilityInference#13 · 1 reaction ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 42/100
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
icsharpcode/NullabilityInference#6 · 2 bình luận ·
-
Flow analysisĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 32/100
icsharpcode/NullabilityInference#5 · 7 bình luận ·
Tất cả issue của icsharpcode/NullabilityInference
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
umbraco/Umbraco.Automate#612 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
崩溃日志只按 CRLF 分行Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
PCL-Community/PCL-CE#3872 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
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