Skip to content
This repository was archived by the owner on Sep 25, 2026. It is now read-only.
This repository was archived by the owner on Sep 25, 2026. It is now read-only.

Linker throws ArgumentException when using local functions from state machine local function #2723

Closed

Description

@sbomer

Discovered in dotnet/runtime#67538. I'm filing a separate linker issue for this since it looks like the runtime issue is being used to track ci coverage holes.

ILLink : error IL1012: IL Trimmer has encountered an unexpected error. Please report the issue at https://github.com/dotnet/linker/issues [/__w/1/s/src/libraries/System.Net.Http/tests/FunctionalTests/System.Net.Http.Functional.Tests.csproj]
##[error]ILLink(0,0): error IL1012: (NETCORE_ENGINEERING_TELEMETRY=Build) IL Trimmer has encountered an unexpected error. Please report the issue at https://github.com/dotnet/linker/issues
  Fatal error in IL Linker
  Unhandled exception. System.ArgumentException: An item with the same key has already been added. Key: System.Void System.Net.Http.Functional.Tests.SocketsHttpHandler_Http2FlowControl_Test::<TestClientWindowScalingAsync>g__Wait|13_2(System.TimeSpan)
     at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
     at Mono.Linker.CompilerGeneratedState.PopulateCacheForType(TypeDefinition type)
     at Mono.Linker.CompilerGeneratedState.TryGetOwningMethodForCompilerGeneratedMember(IMemberDefinition sourceMember, MethodDefinition& owningMethod)
     at Mono.Linker.Steps.MarkStep.ShouldSuppressAnalysisWarningsForRequiresUnreferencedCode()
     at Mono.Linker.Steps.MarkStep.CheckAndReportRequiresUnreferencedCode(MethodDefinition method)
     at Mono.Linker.Steps.MarkStep.ProcessAnalysisAnnotationsForMethod(MethodDefinition method, DependencyKind dependencyKind)
     at Mono.Linker.Steps.MarkStep.MarkMethod(MethodReference reference, DependencyInfo reason)
     at Mono.Linker.Steps.MarkStep.MarkCustomAttribute(CustomAttribute ca, DependencyInfo& reason)
     at Mono.Linker.Steps.MarkStep.MarkCustomAttributes(ICustomAttributeProvider provider, DependencyInfo& reason)
     at Mono.Linker.Steps.MarkStep.MarkType(TypeReference reference, DependencyInfo reason, Nullable`1 origin)
     at Mono.Linker.Steps.MarkStep.MarkField(FieldDefinition field, DependencyInfo& reason)
     at Mono.Linker.Steps.MarkStep.MarkEntireType(TypeDefinition type, DependencyInfo& reason)
     at Mono.Linker.Steps.MarkStep.MarkEntireType(TypeDefinition type, DependencyInfo& reason)
     at Mono.Linker.Steps.MarkStep.MarkEntireAssembly(AssemblyDefinition assembly)
     at Mono.Linker.Steps.MarkStep.MarkAssembly(AssemblyDefinition assembly, DependencyInfo reason)
     at Mono.Linker.Steps.MarkStep.MarkModule(ModuleDefinition module, DependencyInfo reason)
     at Mono.Linker.Steps.MarkStep.ProcessMarkedPending()
     at Mono.Linker.Steps.MarkStep.Initialize()
     at Mono.Linker.Steps.MarkStep.Process(LinkContext context)
     at Mono.Linker.Pipeline.ProcessStep(LinkContext context, IStep step)
     at Mono.Linker.Pipeline.Process(LinkContext context)
     at Mono.Linker.Driver.Run(ILogger customLogger, Boolean throwOnFatalLinkerException)
     at Mono.Linker.Driver.Main(String[] args)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions