Inference status: ICSharpCode.Decompiler
還沒有人認領這個 Issue。
評估
研究方向
未指定檔案、測試或具體變更;該 issue 是 InferNull 對 ICSharpCode.Decompiler 執行時的進度報告。首先檢查與 unconstrained generics、notnull constraints、未初始化欄位以及 Roslyn 的 property-setter 處理相關的推論路徑。完成的定義僅限於減少或解決列出的 nullable-reference 警告。
由索引模型根據 Issue 內容生成。
描述
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
- 主要語言
- C#
- 星號
- 38
- 分支
- 6
- PR 合併指標
- 30 天內沒有已合併 PR
環境準備
這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
icsharpcode/NullabilityInference 的其他 Issue
-
難度 4/5 3-5 天 新手友好度 35/100
icsharpcode/NullabilityInference#13 · 1 個 reaction ·
-
難度 3/5 1-2 天 新手友好度 42/100
-
難度 5/5 一週以上 新手友好度 35/100
-
難度 5/5 一週以上 新手友好度 25/100
icsharpcode/NullabilityInference#6 · 2 則留言 ·
-
Flow analysis未關閉
難度 5/5 一週以上 新手友好度 32/100
icsharpcode/NullabilityInference#5 · 7 則留言 ·
查看 icsharpcode/NullabilityInference 的全部 Issue
相似的 Issue
-
bug
難度 2/5 1-3 小時 新手友好度 72/100
維護者通常 3 天內回覆
-
bug python
難度 1/5 1 小時以內 新手友好度 88/100
ilia-sokolov/OfficeAgent.NET#89 ·
維護者通常 13 天內回覆
-
documentation
難度 2/5 1-3 小時 新手友好度 82/100
juandresrodca/AdminForge#66 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 70/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 72/100
umbraco/Umbraco.Automate#612 ·
維護者通常 1 天內回覆