Skip to content

Internal error when abbreviating types with extension members #16389

@auduchinok

Description

@auduchinok

Consider these C# and F# projects:

namespace CSharpLib;

public interface I
{
    public int P { get; }
}

public static class Ext
{
    public static void M(this I i)
    {
    }
}
open CSharpLib

module M =
    type Ext = CSharpLib.Ext

    let f (i: I) =
        i.M()

This fails to build when using .NET 8 SDK:

2>Program.fs(7,9): Error FS0073 : internal error: ImportILTypeRef: unexpected local scope

This is a recent regression, the same project builds fine when using .NET 7 SDK.

In addition to the failing build, it also breaks member code completion for extended type instances in a recent FCS:

Screenshot 2023-12-05 at 17 26 33

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions