You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Debug: FS2014 duplicate <f>__debug@N in method table for an inline call inside a resumable CE whose Run has caller-info parameters (regression in 11.0.100-rc.2) #20836
Lib.fs, in a net10.0 library, built with dotnet build -c Debug on SDK 11.0.100-rc.2.26504.105:
moduleLib#nowarn"3513"openSystem.Runtime.CompilerServicesopenSystem.Runtime.InteropServicesopenMicrosoft.FSharp.Core.CompilerServicesopenMicrosoft.FSharp.Core.CompilerServices.StateMachineHelpers[<Struct; NoEquality; NoComparison>]typeD<'T>={mutable Result:'T }typeB()=member inline_.Delay([<InlineIfLambda>]f:unit ->ResumableCode<'D,'T>)=
ResumableCode<'D, 'T>(fun sm ->(f ()).Invoke(&sm))member inline_.Return(v:'T)= ResumableCode<D<'T>, 'T>(fun sm -> sm.Data.Result <- v;true)member inline_.Run(code:ResumableCode<D<'T>,'T>,[<CallerLineNumber; Optional; DefaultParameterValue(0)>]line:int):'T =if__useResumableCode then__stateMachine<D<'T>, 'T>(MoveNextMethodImpl<D<'T>>(fun sm ->__resumeAt sm.ResumptionPoint; code.Invoke(&sm)|> ignore))(SetStateMachineMethodImpl<D<'T>>(fun _ _ ->()))(AfterCode<D<'T>, 'T>(fun sm -> sm.Data.Result))elselet mutablesm= ResumableStateMachine<D<'T>>()
code.Invoke(&sm)|> ignore
sm.Data.Result
letb= B()letf():int = b {return[3]|> List.sum }
Result
error FS2014: A problem occurred writing the binary 'obj/Debug/net10.0/refint/repro.dll': Error in pass2 for type Lib, error: duplicate entry '<sum>__debug@28' in method table
Narrowing
Variation
rc.2 Debug
As above
FS2014
-p:ProduceReferenceAssembly=false
FS2014 (on the main dll instead of refint)
Run without the [<CallerLineNumber>] parameter
builds
Body without an inline call (b { return 3 })
builds
task { return [ 3 ] |> List.sum }
builds
Non-resumable builder with the same caller-info Run
builds
Release
builds
Same repro on SDK 11.0.100-rc.1.26425.128 (Debug)
builds
In a builder of the same shape (no inline call in the body), rc.2 Debug now emits the state-machine struct and the dynamic-path closures for one CE, where rc.1 Debug emitted only the closure. So both branches of if __useResumableCode seem to survive, and an inline call in the body is specialized once per branch, under the same <f>__debug@<line> name. This looks related to #20469 ("Preserve resumable state-machine lowering in Debug"), merged between rc.1 and rc.2.
This also reaches .NET 10 servicing. #20692 backported #20469 to release/10.0.4xx. Building the compiler from that branch and compiling FSharp.Interop.Dlr's tests in Debug, on macOS arm64:
The shipped SDK 10.0.403 (compiler 15.2.403-servicing.26512.108, built before #20692) builds it fine, so the next 10.0.4xx servicing SDK would be the first to break it. Could #20846 be backported to release/10.0.4xx as well, before that release?
Activity
auduchinok commentedon Oct 21, 2026
I'll look at it.
jbtule commentedon Oct 24, 2026
This also reaches .NET 10 servicing. #20692 backported #20469 to
release/10.0.4xx. Building the compiler from that branch and compiling FSharp.Interop.Dlr's tests in Debug, on macOS arm64:release/10.0.4xxduplicate entry '<sum>__debug@4010' in method tableThe shipped SDK 10.0.403 (compiler
15.2.403-servicing.26512.108, built before #20692) builds it fine, so the next 10.0.4xx servicing SDK would be the first to break it. Could #20846 be backported torelease/10.0.4xxas well, before that release?Generated by Claude Code
Caller info on Delay, not Run: dlr { } builds in Debug on the 11.0 co…