Fsharp: Too many type variables

Created on 30 Oct 2019  路  2Comments  路  Source: dotnet/fsharp

Code like this:

let inline yeet a b c d e = (c - d) * a + (e * f) // ...
yeet 1.0 2.0 3.0 4.0 5.0

Ends up creating a lot of type variables that leak out into tooltips:

yeet

Additionally, the ... in the tooltip implies we'll elide info about concrete instantiations, but we do not.

It's also probably worth finding a better way to format all of the constraints, since a single line for that many of them makes the VS tooltips go wild.

Area-Compiler Area-FCS Severity-Low bug

Most helpful comment

If you're talking about readability of tooltips... Here's a hilarious one (and that's only a partial screenshot):

image

What happens here is that the tooltip becomes unreadable if you have many overloads. In the past, it just listed a few and then "..." or something similar.

All 2 comments

Can confirm.

For a real-world example:

let lerp a b t te = (te - t) * a + (t * b)

Creates 8(!) types.

If you're talking about readability of tooltips... Here's a hilarious one (and that's only a partial screenshot):

image

What happens here is that the tooltip becomes unreadable if you have many overloads. In the past, it just listed a few and then "..." or something similar.

Was this page helpful?
0 / 5 - 0 ratings