Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007711OCamltypingpublic2018-01-18 19:542018-01-30 08:09
Reporteroctachron 
Assigned Togarrigue 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version4.07.0+dev 
Target VersionFixed in Version4.07.0+dev 
Summary0007711: Internal typechecker error triggered by a constraint on self type in a class type
DescriptionThe 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.
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0018853)
garrigue (manager)
2018-01-23 04:49

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.
(0018856)
garrigue (manager)
2018-01-24 06:00

Tentative fix: https://github.com/ocaml/ocaml/pull/1581 [^]

Not so clean as it adds cruft to unify3, but I see no other easy way.
(0018861)
garrigue (manager)
2018-01-30 08:09

Fixed by commit 54225b51c in trunk.

- Issue History
Date Modified Username Field Change
2018-01-18 19:54 octachron New Issue
2018-01-18 19:58 octachron Description Updated View Revisions
2018-01-23 04:49 garrigue Note Added: 0018853
2018-01-23 04:49 garrigue Assigned To => garrigue
2018-01-23 04:49 garrigue Status new => confirmed
2018-01-24 06:00 garrigue Note Added: 0018856
2018-01-30 08:09 garrigue Note Added: 0018861
2018-01-30 08:09 garrigue Status confirmed => resolved
2018-01-30 08:09 garrigue Fixed in Version => 4.07.0+dev
2018-01-30 08:09 garrigue Resolution open => fixed


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker