dotnet / dotnet/fsharp

duplicate entry '.cctor' in method table

Open
#19,445 0 comments 0 reactions 0 assignees View on GitHub
Area-Compiler-CodeGen Bug
Dominant language
F#
Stars
4.3k
Forks
876
Avg merge
4d 22h
Merged PRs (30d)
144

Description

Please provide a succinct description of the issue.

**Repro steps**
``
type U<'T> =
| A
static member val X = 3
``
**Expected behavior**

Per https://github.com/dotnet/fsharp/issues/19187, this should be fixed, however it still exists.

**Actual behavior**

```
root@gemini4_2:/workspace$ dotnet fsi

Microsoft (R) F# Interactive version 15.2.201.0 for F# 10.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

For help type #help;;

> type U<'T> = | A static member val X = 3;;
Duplicate in method table is:
Type index: 3
Method name: .cctor
Method arity (num generic params): 0

error FS0192: internal error: Error in pass2 for type FSI_0002, error: Error in pass2 for type U`1, error: duplicate entry '.cctor' in method table

>

```

**Known workarounds**

Still
``
> type U<'T> =
| A of unit
static member val X = 3
;;
type U<'T> =
| A of unit
static member X: int

>
``

**Related information**

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.