dotnet / dotnet/fsharp

Can't define extensions for two same named types in a single module

Open
#18,815 0 comments 3 reactions 0 assignees View on GitHub
Area-Compiler-CodeGen Bug
Dominant language
F#
Stars
4.3k
Forks
876
Avg merge
4d 11h
Merged PRs (30d)
131

Description

```fsharp
module Compiled

type Task = { F: int }

module CompiledExtensions =
type System.Threading.Tasks.Task with
static member CompiledStaticExtension() = ()

type Task with
static member CompiledStaticExtension() = ()
```

```
Error FS2014:
A problem occurred writing the binary 'obj\Debug\net9.0\refint\Compiled.dll': Error in pass2 for type Compiled, error:
Error in pass2 for type CompiledExtensions, error: duplicate entry 'Task.CompiledStaticExtension.Static' in method table
```

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.