dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.07k stars 4.69k forks source link

Data flow analysis: Track value's static type across boxing/unboxing #93718

Open vitek-karas opened 3 years ago

vitek-karas commented 3 years ago

Currently boxing and unboxing operations leave unknown type on the stack, even if the input value has known static type. We should improve this so that the static type propagates across boxing/unboxing where possible.

Note: boxing has special handling of Nullable<> so this is not as simple as it seems.

ghost commented 11 months ago

Tagging subscribers to this area: @agocke, @sbomer, @vitek-karas See info in area-owners.md if you want to be subscribed.

Issue Details
Currently boxing and unboxing operations leave unknown type on the stack, even if the input value has known static type. We should improve this so that the static type propagates across boxing/unboxing where possible. Note: boxing has special handling of `Nullable<>` so this is not as simple as it seems.
Author: vitek-karas
Assignees: -
Labels: `untriaged`, `area-Tools-ILLink`, `needs-area-label`
Milestone: -
vitek-karas commented 11 months ago

Note that analyzer doesn't have this problem because it doesn't see boxing.