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
Release-only InvalidProgramException: Seq.collect over a struct collection (ImmutableArray) materialised with List.ofSeq #20203
Seq.collect whose 'Collection type parameter is instantiated to a struct collection (e.g. ImmutableArray<T>), materialised with List.ofSeq/Seq.toList, produces invalid IL under release optimization.
Repro
moduleReproopenSystemopenSystem.Collections.Immutableletf()=[ ImmutableArray.Create(1,2)]|> Seq.collect id |> List.ofSeq
[<EntryPoint>]letmain _ =
Console.WriteLine((f()).Length)0
dotnet run -c Debug prints 2. dotnet run -c Release:
Unhandled exception. System.InvalidProgramException: Common Language Runtime detected an invalid program.
at Repro.f()
changed the title [-]Release-only InvalidProgramException: yield! over Seq.collect of ImmutableArray in a list comprehension[/-][+]Release-only InvalidProgramException: Seq.collect over a struct collection (ImmutableArray) materialised with List.ofSeq[/+]on Aug 4, 2026
Activity
[-]Release-only InvalidProgramException: yield! over Seq.collect of ImmutableArray in a list comprehension[/-][+]Release-only InvalidProgramException: Seq.collect over a struct collection (ImmutableArray) materialised with List.ofSeq[/+]test: RED repro for #20203 struct Seq.collect InvalidProgramException
fix: coerce struct sub-collection and use unit try/finally result typ…
test: regenerate ComputedCollections baselines and pin struct-collect…
test: parameterize #20203 struct Seq.collect scenarios + release notes
Fix Release-only InvalidProgramException for Seq.collect/List.ofSeq o…
Update EmittedIL baselines and pin struct-seq collector IL (#20203)
Add release notes for Seq.collect struct-seq InvalidProgramException …
Regenerate remaining EmittedIL baselines for #20203 (ListExpressionSt…