dotnet / dotnet/fsharp

Signature file generation should use F# Core alias

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

Description

When generating a signature file from a type extension with a BCL type (or at least a type that F# Core abbreviated) the full type is used instead of the abbreviated one.

**Repro steps**

```fsharp
module Hej

type System.Int32 with
member i.PlusPlus () = i + 1
member i.PlusPlusPlus () : int = i + 1 + 1

type X(y:int) =
member x.PlusPlus () = y + 1
```

leads to

```fsharp
module Hej
type System.Int32 with

member PlusPlus: unit -> System.Int32
type System.Int32 with

member PlusPlusPlus: unit -> int

type X =

new: y: int -> X

member PlusPlus: unit -> int
```

**Expected behaviour**

This is more cosmetic but I was expecting to see `unit -> int` in all examples.

**Actual behaviour**

`System.Int32` is used when the type is not specified.

**Known workarounds**

Add return type `int` explicitly.

**Related information**

Provide any related information (optional):

* Operating system
* .NET Runtime kind (.NET Core, .NET Framework, Mono)
* Editing Tools (e.g. Visual Studio Version, Visual Studio)

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.