Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

map and fold filters generate wrong code for abstract types #4309

Closed
vicuna opened this issue Jun 5, 2007 · 1 comment
Closed

map and fold filters generate wrong code for abstract types #4309

vicuna opened this issue Jun 5, 2007 · 1 comment

Comments

@vicuna
Copy link

vicuna commented Jun 5, 2007

Original bug ID: 4309
Reporter: @yallop
Assigned to: ertai
Status: closed (set by @xavierleroy on 2010-04-29T12:26:19Z)
Resolution: fixed
Priority: normal
Severity: major
Version: 3.10.0
Fixed in version: 3.10+dev
Category: -for Camlp4 use https://github.com/ocaml/camlp4/issues
Monitored by: @yallop

Bug description

Here's a test case:

module M = Map.Make(String)
type t = int M.t

class map = Camlp4Filters.GenerateMap.generated
class fold = Camlp4Filters.GenerateFold.generated

The code generated includes unapplied occurrences of M.t:

...
method _M_t : M.t -> M.t = fun x -> x
method t : t -> t = o#_M_t o#int
...
method _M_t : M.t -> 'self_type = fun _ -> o
method t : t -> 'self_type = o#_M_t (fun o -> o#int)
...

This is using `camlp4o -filter fold -filter map'

@vicuna
Copy link
Author

vicuna commented Jun 23, 2007

Comment author: ertai

This is now fixed in the CVS.

I've done many improvments on these generators, one can now generates Map, Map2, Map3... Fold, Fold2, Fold3..., FoldMap, FoldMap2, FoldMap3...

Only the last type declaration is taken in account. And unknown types yield calls the "unknown" method. Typically one can inherit and change definitions that yield unknown.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant