fsharp
fsharp copied to clipboard
[generics/error message] `?typeid` shown in error message for missing type constraint
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)'


Related information
vs 2019 16.0.3 ionide 3.37.0
Labeling as a bug due to not wanting to leak the type ID here. The missing constraint is correct though.
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
Duplicate of https://github.com/dotnet/fsharp/issues/385
This was closed as duplicate, but the resolution of the duplicate did not resolve this one. Reopening, as the typeid-error is still there:
Related: #3508