Navigation Menu

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

In GADT's, _ type variables are replaced with 'a, 'b, etc #5449

Closed
vicuna opened this issue Dec 23, 2011 · 2 comments
Closed

In GADT's, _ type variables are replaced with 'a, 'b, etc #5449

vicuna opened this issue Dec 23, 2011 · 2 comments
Assignees

Comments

@vicuna
Copy link

vicuna commented Dec 23, 2011

Original bug ID: 5449
Reporter: pilki
Assigned to: @garrigue
Status: closed (set by @garrigue on 2011-12-28T02:24:01Z)
Resolution: fixed
Severity: feature
Fixed in version: 3.13.0+dev
Category: ~DO NOT USE (was: OCaml general)
Child of: #5444
Monitored by: @protz

Bug description

When you define the gadt:
<<<
type 'int eq_int = EqInt : int eq_int

ocamlc -i produces the correct interface
<<<
type 'int eq_int = EqInt : int eq_int

But if you define
<<<
type (_, _) eq = Eq: ('a, 'a) eq

you obtain
<<<
type ('a, 'b) eq = Eq : ('a, 'a) eq

where the _s have been replaced by type variables. The _ should be kept

@vicuna
Copy link
Author

vicuna commented Dec 24, 2011

Comment author: @garrigue

I see the point.
Having new variables appear in type definitions may be confusing.
However "_" is not a real variable name, so this requires some thinking.
Maybe we could have just a special behavior only for type definitions,
as one cannot add a constraint to an unnamed type parameter inside the
definition.

@vicuna
Copy link
Author

vicuna commented Dec 28, 2011

Comment author: @garrigue

Fixed in Printtyp and Oprint, revision 11964.

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

2 participants