Skip to content

FS0073: internal error: ImportILTypeRef: unexpected local scope using System.Collections.Immutable #16321

Closed
@marklam

Description

@marklam

Calling ImmutableQueue.Dequeue or IImmutableStack.Pop causes internal compiler errors

Repro steps

  1. Clone https://github.com/fsprojects/FSharp.Collections.Immutable
  2. dotnet build

Expected behavior

Compilation succeeds

Actual behavior

FSharp.Collections.Immutable\src\FSharp.Collections.Immutable\stack.fs(33,9): error FS0073: internal error: ImportILTypeRef: unexpected local scope
FSharp.Collections.Immutable\src\FSharp.Collections.Immutable\stack.fs(42,33): error FS0073: internal error: ImportILTypeRef: unexpected local scope
FSharp.Collections.Immutable\src\FSharp.Collections.Immutable\queue.fs(28,47): error FS0073: internal error: ImportILTypeRef: unexpected local scope

Known workarounds

As per @vzarytovskii 's comment below, Adding <LangVersion>7.0</LangVersion> to a PropertyGroup in the fsproj allows the compilation to succeed.

Related information

  • Operating system : Windows 10
c:\git>dotnet --list-sdks
6.0.417 [C:\Program Files\dotnet\sdk]
8.0.100 [C:\Program Files\dotnet\sdk]

Metadata

Metadata

Assignees

Labels

Area-Compiler-ImportAndInteropimport of .NET DLLs and interopBugImpact-Medium(Internal MS Team use only) Describes an issue with moderate impact on existing code.Regression

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions