Skip to content

Conversation

@vitek-karas
Copy link
Member

Previously we only marked the type forwarder for the outer-most type (if any), but the same problem can happen with type names in generic arguments. If they are forwarder we need to mark those type forwarders as well.

This change records all type resolutions during the string->Type resolution and then makes sure that all type forwarders used get marked.

Renamed a method on HandleCallAction to make it more descriptive of what it actually does. Also unifies all string->Type resolution into the ReflectionMarker.

Enabled test which has been already added for the bug and added another variation (CreateInstance).

Improved ResultsChecker to include assembly names in validation messages.

Fixes #1536

Previously we only marked the type forwarder for the outer-most type (if any), but the same problem can happen with type names in generic arguments. If they are forwarder we need to mark those type forwarders as well.

This change records all type resolutions during the string->Type resolution and then makes sure that all type forwarders used get marked.

Renamed a method on HandleCallAction to make it more descriptive of what it actually does. Also unifies all string->Type resolution into the ReflectionMarker.

Enabled test which has been already added for the bug and added another variation (CreateInstance).

Improved ResultsChecker to include assembly names in validation messages.
Copy link
Member

@sbomer sbomer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

Copy link
Member

@jtschuster jtschuster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

@vitek-karas vitek-karas merged commit 27b9dd6 into dotnet:main Jun 13, 2022
@vitek-karas vitek-karas deleted the MarkForwardersInTypeResolution branch June 13, 2022 21:19
agocke pushed a commit to dotnet/runtime that referenced this pull request Nov 16, 2022
…linker#2836)

Previously we only marked the type forwarder for the outer-most type (if any), but the same problem can happen with type names in generic arguments. If they are forwarder we need to mark those type forwarders as well.

This change records all type resolutions during the string->Type resolution and then makes sure that all type forwarders used get marked.

Renamed a method on HandleCallAction to make it more descriptive of what it actually does. Also unifies all string->Type resolution into the ReflectionMarker.

Enabled test which has been already added for the bug and added another variation (CreateInstance).

Improved ResultsChecker to include assembly names in validation messages.

Commit migrated from dotnet/linker@27b9dd6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DynamicallyAccessedMembers with a string TypeName of a generic type with different assemblies doesn't appear to work

3 participants