Define model for tracking arrays in trim analysis

Open
#117,167 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
csharp
Domain
compilers

Research direction

Start by reading the linked issues 87596, 117174, 93416, and 90335 to understand the problematic array-tracking behaviors and the requirements for MakeGenericType validation. Define the array model so the referenced problems are fixed, then verify each linked issue's scenario is resolved.

Written by the indexing model from the issue text.

Description

area-Tools-ILLink

Our dataflow models arrays, mainly to support MakeGenericType patterns like this:

typeof(Dictionary<,>).MakeGenericType(new Type[] { typeof(Key), typeof(Value) });

where in general, we need to validate that the type arguments satisfy any requirements on the type parameters.

Our dataflow system isn't currently designed to track mutable reference types, so the array support is not well-defined. This leads to a number of problematic behaviors:

Opening this as a top-level issue where we can track the work. All of the problems described in the above issues should be fixed when this work is done.

Dominant language
C#
Stars
18.3k
Forks
5.6k
PR merge metrics
PR metrics pending

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from dotnet/runtime

All issues in dotnet/runtime

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.