This repository was archived by the owner on Sep 25, 2026. It is now read-only.
Repository navigation
Share MakeGeneric.. and Expression.Call - #2758
Merged
Merged
Conversation
sbomer
approved these changes
Apr 23, 2022
| } | ||
|
|
||
| [ExpectedWarning ("IL2060", nameof (MethodInfo.MakeGenericMethod))] | ||
| // https://github.com/dotnet/linker/issues/2158 - analyzer doesn't work the same as linker, it simply doesn't handle refs |
Member
Author
There was a problem hiding this comment.
Kind of both - I think we need ref tracking in order to implement array reset in this case.
| } | ||
| // We haven't found any generic parameters with annotations, so there's nothing to validate. | ||
| } else if (value == NullValue.Instance) { | ||
| // Do nothing - null value is valid and should not cause warnings nor marking |
Member
There was a problem hiding this comment.
It looks like the null case will effectively return null, should that be fixed to return TopValue?
Member
Author
There was a problem hiding this comment.
You're right. The end result is the same since any reflection API will ignore the null on input anyway, but it's better to track it as empty here.
And the comment is wrong. MakeGenericType throws if "this" is null - obviously :-)
Co-authored-by: Sven Boemer <[email protected]>
agocke
pushed a commit
to dotnet/runtime
that referenced
this pull request
Nov 16, 2022
Moves the intrinsic handling of `MakeGenericType`, `MakeGenericMethod` and `Expression.Call` into the shared code. Other changes: * Some small refactorings on the shared type system and value system. * Expose generic parameters on type system proxies * Fix a bug in analyzer when we're recording patterns, the values must be cloned (as they can mutate during analysis after the record is taken) * Fix some problems in Nullable<T> handling in MakeGenericType - specifically if we don't know what the T is going to be, we now return just Nullable<> known type (but unknown T). * Add couple new tests - update existing ones (mainly due to limitation in the analyzer) Co-authored-by: Sven Boemer <[email protected]> Commit migrated from dotnet/linker@bf4d43b
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Moves the intrinsic handling of
MakeGenericType,MakeGenericMethodandExpression.Callinto the shared code.Other changes: