This is basically an issue to make NativeAOT pass the test CompilerGeneratedCodeInPreservedAssembly
The scenario is an assembly which is entirely preserved via a descriptor XML and it contains unreachable code in constant condition branch which is compiler generated and triggers a data flow warning. This should not produce a warning, but it still does.
public static void WithLocalFunction ()
{
if (AlwaysFalse) {
LocalWithWarning ();
}
[ExpectedWarning ("IL2026", ProducedBy = Tool.Analyzer | Tool.NativeAot)] // Bug
void LocalWithWarning ()
{
Requires ();
}
}