You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 5322 Reporter: poluxmoon Status: closed (set by @garrigue on 2011-07-29T01:56:43Z) Resolution: fixed Priority: normal Severity: minor Version: 3.12.0 Fixed in version: 3.13.0+dev Category: ~DO NOT USE (was: OCaml general)
Bug description
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
Additional information
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).
Thanks for your report.
Both Ctype.unify3 and Ctype.moregen didn't consider the possibility that a type abbreviation may expand to a universal type variable.
This is now fixed in both trunk and 3.12 branch (revision 11159).
Original bug ID: 5322
Reporter: poluxmoon
Status: closed (set by @garrigue on 2011-07-29T01:56:43Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 3.12.0
Fixed in version: 3.13.0+dev
Category: ~DO NOT USE (was: OCaml general)
Bug description
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
Additional information
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).
File attachments
The text was updated successfully, but these errors were encountered: