Skip to content

Typer: save nice representation for polymorphic types

Currently the typer saves information about a type name, e.g. if I have type x = A | B I can understand that type of v in let v = A from the orig_var field. But if I declare a polymorphic type like type 'a x = A of a | B, I can't obtain int x from the type for A 5, or 'a x from type of B.

As in https://tezos-dev.slack.com/archives/C04EM6W78A0/p1687958500529329, this lead e.g. to non-pretty hovers in LSP:

image

Also type variables that are generated by the typer have non-pretty names like in

image, probably the var name should come from the declaration, i.e. since the definition for endo has 'a I want to see 'a#... to amke just 'a manually later

Edited by Sorokin-Anton