Original bug ID: 7711 Reporter:@Octachron Assigned to:@garrigue Status: resolved (set by @garrigue on 2018-01-30T07:09:55Z) Resolution: fixed Priority: normal Severity: minor Version: 4.07.0+dev/beta2/rc1/rc2 Fixed in version: 4.07.0+dev/beta2/rc1/rc2 Category: typing Monitored by:@nojb@gasche
Bug description
The following code fails (on ? — 4.02.3 — trunk) with a failed assertion in Ctype.object_fields:
type 'a r = <w: int -> int; .. > as 'a
class type virtual ct = object('self)
constraint 'self = 'not_self r
end
Note also that the snippet above compiles fine if 'not_self is replaced by 'self, if the type constructor r is inlined, or if ct is made a virtual class.
The text was updated successfully, but these errors were encountered:
That's a bad one.
I think it's been there since the very beginning of ocaml:
functions all over the place seem to assume that the signature of a class is an object type, never an abbreviation, but nothing prevents from unifying it with an abbreviation.
I see no easy solution short of changing the type of csig_self to something safer.
The simplest change would be to use type_desc rather than type_expr.
Original bug ID: 7711
Reporter: @Octachron
Assigned to: @garrigue
Status: resolved (set by @garrigue on 2018-01-30T07:09:55Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 4.07.0+dev/beta2/rc1/rc2
Fixed in version: 4.07.0+dev/beta2/rc1/rc2
Category: typing
Monitored by: @nojb @gasche
Bug description
The following code fails (on ? — 4.02.3 — trunk) with a failed assertion in Ctype.object_fields:
type 'a r = <w: int -> int; .. > as 'a
class type virtual ct = object('self)
constraint 'self = 'not_self r
end
Note also that the snippet above compiles fine if 'not_self is replaced by 'self, if the type constructor r is inlined, or if ct is made a virtual class.
The text was updated successfully, but these errors were encountered: