fsharp icon indicating copy to clipboard operation
fsharp copied to clipboard

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

Open smoothdeveloper opened this issue 6 years ago • 4 comments

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

smoothdeveloper avatar May 14 '19 05:05 smoothdeveloper

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

cartermp avatar May 14 '19 14:05 cartermp

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

smoothdeveloper avatar May 16 '19 08:05 smoothdeveloper

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

dsyme avatar Nov 05 '21 23:11 dsyme

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

abelbraaksma avatar May 16 '24 18:05 abelbraaksma