Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always create constructed MethodTable for MdArray & co. #103696

Merged
merged 1 commit into from
Jun 19, 2024

Conversation

MichalStrehovsky
Copy link
Member

Arrays that don't implement generic interface methods can be loaded at runtime without any sort of type loader template (their template is the same thing that we just whack into the right shape and there's no associated code because everything is from System.Array). But this means we should never create unconstructed MethodTable for these because we could end up in a situation where a single type has two MethodTables. The regression test demonstrates how that can happen (the is check only forces unconstructed form of the MethodTable).

Ran into this while working on a different PR, but I don't want to clutter that one with this.

Cc @dotnet/ilc-contrib

Arrays that don't implement generic interface methods can be loaded at runtime without any sort of type loader template (their template is the same thing that we just whack into the right shape and there's no associated code because everything is from `System.Array`). But this means we should never create unconstructed MethodTable for these because we could end up in a situation where a single type has two `MethodTable`s. The regression test demonstrates how that can happen (the `is` check only forces unconstructed form of the `MethodTable`).

Ran into this while working on a different PR, but I don't want to clutter that one with this.
Copy link
Contributor

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

Copy link
Member

@agocke agocke left a comment

Choose a reason for hiding this comment

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

Huh, had no idea that multi-dimensional arrays didn't implement IEnumerable<T>. LGTM

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.

None yet

2 participants