dotnet / dotnet/fsharp

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

Open
#17,828 2 comments 0 reactions 0 assignees View on GitHub
Area-Compiler-Checking Area-Compiler-Checking-NameResolution Bug Impact-Low
Dominant language
F#
Stars
4.3k
Forks
876
Avg merge
4d 22h
Merged PRs (30d)
144

Description

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:
```fsharp
namespace Ns.TypeName
```

File2.fs:
```fsharp
namespace Ns

type TypeName = { Field: int }

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

Reference this project from the following console app one:
```Program.fs
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](https://github.com/user-attachments/files/17221650/SameNameNamespaceType.zip).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.