Skip to content

Array comprehension no longer compiles on rc1 #17708

@sayurin

Description

@sayurin

Please provide a succinct description of the issue.

Repro steps

Following code causes compile error on .NET 9 RC1.

let arr = [| for _ in Array.groupBy id [||] do 0 |]

Expected behavior

.NET 8 can compile it, successfully.

Actual behavior

.NET 9 RC1 fails with following error.

FSC : error FS2014: A problem occurred writing the binary 'obj\Release\net9.0\refint\FsConsoleApp3.dll': duplicate entry 'arr@1' in type index table

Known workarounds

split it.

let arr = [|
    let arr = Array.groupBy id [||]
    for _ in arr do 0
|]

Related information

Provide any related information (optional):

  • Windows 11
  • .NET 9 RC1
  • Visual Studio Professional 2022 Preview 17.12.0 Preview 2.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    New

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions