-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Validate constraints on created MethodTables #84613
Conversation
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.
Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas Issue DetailsWe have too many IL tests in the src/tests tree that validate invalid things throw Cc @dotnet/ilc-contrib
|
// 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 |
There was a problem hiding this comment.
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:
runtime/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCompilerContext.cs
Lines 134 to 141 in 1487522
/// <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; | |
} |
/azp run runtime-extra-platforms |
Azure Pipelines successfully started running 1 pipeline(s). |
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