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.94k stars 788 forks source link

[generics/error message] `?typeid` shown in error message for missing type constraint #6725

Open smoothdeveloper opened 5 years ago

smoothdeveloper commented 5 years ago

This code exposes internally generated type identifiers in error messages:

Repro steps

type C() =
    static member M<'a,'b>(a: 'a, b: 'b) = a + b

Expected behavior

A type parameter is missing a constraint 'when ( ^a or ^b) : (static member ( + ) : ^a * ^b -> ^c) ...'

Actual behavior

A type parameter is missing a constraint 'when ( ^a or ^b) : (static member ( + ) : ^a * ^b -> ^?8018)'

image

image

Related information

vs 2019 16.0.3 ionide 3.37.0

cartermp commented 5 years ago

Labeling as a bug due to not wanting to leak the type ID here. The missing constraint is correct though.

smoothdeveloper commented 5 years ago

probable location of the bug, or the callsite which gives some display settings as input parameter:

https://github.com/dotnet/fsharp/blob/2046609d307e5616f8288cf9b4d0a2c04a4c17ef/src/fsharp/NicePrint.fs#L782-L804

dsyme commented 3 years ago

Duplicate of https://github.com/dotnet/fsharp/issues/385

abelbraaksma commented 6 months ago

This was closed as duplicate, but the resolution of the duplicate did not resolve this one. Reopening, as the typeid-error is still there: image

Related: #3508