Hi,
I have a type error on code similar to :
-----
type 'par t = 'par
let ident v = v
class alias =
object
method alias : 'a . 'a t -> 'a = ident (* type error here *)
end
-----
Which gives :
-----
Error: This expression has type 'a. 'a t -> 'a
but an expression was expected of type 'b. 'b t -> 'b
Type 'a a = 'a is not compatible with type 'b t = 'b
-----
The problem is related to unification of foralls containing named type in a method.
The compiler accepts equivalent code when not using the named type "t" or when not using a method (see attached file).
Is it a [known] limitation ? Is there a way to work around it ?