dotnet / fsharp

The F# compiler, F# core library, F# language service, and F# tooling integration for Visual Studio
https://dotnet.microsoft.com/languages/fsharp
MIT License
3.92k stars 786 forks source link

Internal error when using a type with collided name from another project #17828

Open auduchinok opened 1 month ago

auduchinok commented 1 month ago

This is likely the same cause as in #17827, however, the misleading error reported there should be fixed separately from this one, as this is likely about resolving references during the unpickling of the serialized F# metadata.

Consider this library project:

File1.fs:

namespace Ns.TypeName

File2.fs:

namespace Ns

type TypeName = { Field: int }

module Module =
    let f (tn: TypeName) = ()

Reference this project from the following console app one:

module Ns.Another

Module.f null

There's an internal error when trying to use the function that uses the type:

Screenshot 2024-10-02 at 10 55 48

Here's the repro project: SameNameNamespaceType.zip.

edgarfgp commented 1 month ago

Similar to https://github.com/dotnet/fsharp/issues/16970

auduchinok commented 1 month ago

Similar to https://github.com/dotnet/fsharp/issues/16970

Yes, indeed, thanks! However, these might still be separate issues in the code.