-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Open
Labels
Milestone
Description
With the change introduced at #70838 it can happen that uninflated generic methods are collected for AOTing. Compiling these methods fails and is skipped, which can be observed by passing --aot=print-skipped to the AOT compiler when compiling:
private static void Foo1<T>(T p) where T : struct
{
}Output:
Skip (gshared failure): void HelloWorld.Program:Foo1<T> (T) ((null))
The root cause of this problem is that the AOT runtime assumes that the index of 'normal' methods is the same as their token as pointed out by @vargaz here, which means that solving this problem would require either:
- to remove this assumption and not to collect uninflated generic methods, or
- mark collected uninflated generic methods to be skipped when compiling
Even though this issue does not cause the AOT compiler to crash, nor it causes runtime failures, it is still an unwanted behaviour.