Repository navigation
Commit 65c1f69
authored
Fix Crossgen2 variance validation for type constraints (dotnet#132809)
## Summary
Crossgen2 applied method generic-constraint variance rules to a generic
type's own constraints. ECMA-335 II.9.7 explicitly leaves type-owned
constraints unrestricted, so valid variant interfaces could fail
automatic validation and omit `READYTORUN_FLAG_SkipTypeValidation`.
This change:
- removes the invalid variance check for type-owned generic constraints
- aligns interface method signature validation with the VM by checking
all instance methods and virtual methods, including static virtual and
static abstract declarations
- adds a ReadyToRun regression test based on the reported constraint
pattern
Fixes dotnet#132724
> [!NOTE]
> This pull request was created with GitHub Copilot.1 parent f047cd1 commit 65c1f69
3 files changed
Lines changed: 45 additions & 13 deletions
File tree
- src/coreclr/tools/aot
- ILCompiler.ReadyToRun.Tests/TestCases
- TypeValidation
- ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
65 | 97 | | |
66 | 98 | | |
67 | 99 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
310 | 310 | | |
311 | 311 | | |
312 | 312 | | |
313 | | - | |
| 313 | + | |
314 | 314 | | |
315 | 315 | | |
316 | 316 | | |
| |||
341 | 341 | | |
342 | 342 | | |
343 | 343 | | |
344 | | - | |
345 | | - | |
346 | | - | |
347 | | - | |
348 | | - | |
349 | | - | |
350 | | - | |
351 | | - | |
352 | | - | |
353 | | - | |
354 | | - | |
355 | | - | |
| 344 | + | |
356 | 345 | | |
357 | 346 | | |
358 | 347 | | |
| |||
0 commit comments