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

Type information does not flow to "inherit" parameters #6004

Closed
vicuna opened this issue May 3, 2013 · 3 comments
Closed

Type information does not flow to "inherit" parameters #6004

vicuna opened this issue May 3, 2013 · 3 comments
Assignees

Comments

@vicuna
Copy link

vicuna commented May 3, 2013

Original bug ID: 6004
Reporter: @alainfrisch
Assigned to: @garrigue
Status: closed (set by @xavierleroy on 2015-12-11T18:18:50Z)
Resolution: fixed
Priority: normal
Severity: minor
Fixed in version: 4.01.0+dev
Category: typing
Monitored by: @gasche

Bug description

If we compile the following with -principal:

======================================================================
type t = A
type s = A

class f (_ : t) = object end

let _ = new f A (* ok *)

class g = object
inherit f A (* -> this type-based constructor disambiguation is not principal. *)
end

we get a warning 18, but only on the second occurrence of "f A". Is it normal?

@vicuna
Copy link
Author

vicuna commented May 3, 2013

Comment author: @alainfrisch

Actually, this has nothing to do with the "inherit", since:

class g = f A

is also consider as non-principal.

@vicuna
Copy link
Author

vicuna commented May 3, 2013

Comment author: @garrigue

Indeed, the code for Pcl_apply doesn't generalize the type before calling type_argument.
This shouldn't be hard to do.

@vicuna
Copy link
Author

vicuna commented May 4, 2013

Comment author: @garrigue

Fixed in trunk, commit 13649.

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