Skip to content

NativeAOT difference in behavior to ILLink with descriptor preserved code and constant propagation #85161

@vitek-karas

Description

@vitek-karas

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 ();
			}
		}

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-Tools-ILLink.NET linker development as well as trimming analyzers

    Type

    No type

    Projects

    Status

    No status

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions