Join GitHub today
The top level drops all the "fancy" type variables #5445
Original bug ID: 5445
When "nice" type variables are given for a function, and the function name is then typed in the top level, the type is changed:
let f (x:'foo) = x;;
val f : 'foo -> 'foo =
I often use the top level to give me the type of functions, and if one day "Hashtbl.add" is given a "fancy" type, it would be nice to see it that way.
#show_type might be a solution, but it's longer to type!
Comment author: @garrigue
Names are forgotten when instantiating, and here the type of f is instantiated before being generalized again.