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

Validate constraints on created MethodTables #84613

Merged
merged 1 commit into from
Apr 12, 2023

Conversation

MichalStrehovsky
Copy link
Member

We have too many IL tests in the src/tests tree that validate invalid things throw TypeLoadException. Things that don't meet constraints are one group of those.

Cc @dotnet/ilc-contrib

We have too many IL tests in the src/tests tree that validate invalid things throw `TypeLoadException`. Things that don't meet constraints are one group of those.
@ghost
Copy link

ghost commented Apr 11, 2023

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

Issue Details

We have too many IL tests in the src/tests tree that validate invalid things throw TypeLoadException. Things that don't meet constraints are one group of those.

Cc @dotnet/ilc-contrib

Author: MichalStrehovsky
Assignees: MichalStrehovsky
Labels:

area-NativeAOT-coreclr

Milestone: -

// TODO: validate constraints
// Don't validate constraints with crossgen2 - the type system is not set up correctly
// and doesn't see generic interfaces on arrays.
#if !READYTORUN
Copy link
Member Author

Choose a reason for hiding this comment

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

I peeled this off from #84404. See the failing test leg with crossgen2. This file is shared with crossgen2, but crossgen2 sets up the type system in a way that object[] doesn't implement IEnumerable<object> so we can't run this logic there:

/// <summary>
/// CoreCLR has no Array`1 type to hang the various generic interfaces off.
/// Return nothing at compile time so the runtime figures it out.
/// </summary>
protected override RuntimeInterfacesAlgorithm GetRuntimeInterfacesAlgorithmForNonPointerArrayType(ArrayType type)
{
return BaseTypeRuntimeInterfacesAlgorithm.Instance;
}

@MichalStrehovsky
Copy link
Member Author

/azp run runtime-extra-platforms

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@MichalStrehovsky MichalStrehovsky merged commit 0214c6d into dotnet:main Apr 12, 2023
@MichalStrehovsky MichalStrehovsky deleted the validateconstraints branch April 12, 2023 03:21
@ghost ghost locked as resolved and limited conversation to collaborators May 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants