Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005786OCamlfor Camlp4 use 02:342013-07-28 12:12
Assigned Tohongboz 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0005786: Camlp4 FoldGenerator does not generate visitors for paramatric types
type t =
    A of a item
  | B of b item
and 'a item = Item of 'a
and a = string
and b = int

Will fail to generate the visitors with cryptic message similar to:

File "ghost-location", line 1, characters 0-0:
Warning 17: the virtual method unit is not declared.
File "ghost-location", line 1, characters 0-0:
Error: This class should be virtual.
       The following methods are undefined : unit

Additional InformationIn order to generate the visitors Camlp4 would need to have type reflection. Simple work-around would be good enough in most cases.
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
hongboz (developer)
2012-10-12 02:43

this should be considered as a feature request, since the foldgenerator was quite ad-hoc, and was just used for bootstrapping purpose, it can only handle basic ADT, types like record type, polymorphic variants are not handled well
meyer (developer)
2012-10-12 02:53

indeed it's a feature request. I don't neglect how much work is that, and how useful to me is foldgenerator even in current state.

I suppose we want something more robust then.

I propose the Necula visitors to be close to ideal, implemented in the same way as excellent "deriving" syntax extension.
meyer (developer)
2012-10-12 02:54

I'm open to help if it's needed
hongboz (developer)
2013-07-28 02:59

hi, meyer, I can not reproduce your case in current trunk?

- Issue History
Date Modified Username Field Change
2012-10-12 02:34 meyer New Issue
2012-10-12 02:34 meyer Description Updated View Revisions
2012-10-12 02:35 meyer Description Updated View Revisions
2012-10-12 02:43 hongboz Note Added: 0008244
2012-10-12 02:46 hongboz Assigned To => hongboz
2012-10-12 02:46 hongboz Severity minor => feature
2012-10-12 02:46 hongboz Status new => acknowledged
2012-10-12 02:53 meyer Note Added: 0008245
2012-10-12 02:54 meyer Note Added: 0008246
2013-07-28 02:58 hongboz Assigned To hongboz => meyer
2013-07-28 02:58 hongboz Status acknowledged => assigned
2013-07-28 02:59 hongboz Assigned To meyer => hongboz
2013-07-28 02:59 hongboz Status assigned => feedback
2013-07-28 02:59 hongboz Note Added: 0009913
2016-02-08 12:49 doligez Category Camlp4 => for Camlp4 use [^]
2016-02-08 12:50 doligez Category for Camlp4 use [^] => for Camlp4 use [^]

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker