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

Polymorphic Invariant Compilation #8184

Closed
vicuna opened this issue Jun 25, 2003 · 2 comments
Closed

Polymorphic Invariant Compilation #8184

vicuna opened this issue Jun 25, 2003 · 2 comments
Labels

Comments

@vicuna
Copy link

vicuna commented Jun 25, 2003

Original bug ID: 1727
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)

Bug description

Full_Name: Bow-Yaw Wang
Version: 3.06+36 (2003-06-19)
OS: Mac OS X
Submission from: 140.109.21.73 (140.109.21.73)

I'm trying to implement visitor pattern with polymorphic
variants (Jacques, thanks :)). Here are the files and transcript:

a.mli:
class a :
object ('o)
method invite : 'c 'v . (([>`A of 'o] as 'c) -> 'v) -> 'v
end

a.ml:
class a =
object (self : 'o)
method invite : 'c 'v . (([>A of 'o] as 'c) -> 'v) -> 'v = fun f -> f (A self)
end

dhcp066:$ocamlc -c a.mli
dhcp066:
$ocamlc -c a.ml
Fatal error: exception Assert_failure("typing/btype.ml", 202, 26)

If I type the definition of class a interactively, it compiles without
any problem.

Sorry for not using the stable version. I hope the latest cvs
version can do.

Thanks,

Bow-Yaw

@vicuna
Copy link
Author

vicuna commented Jun 25, 2003

Comment author: administrator

From: bywang@saul.cis.upenn.edu

dhcp066:$ocamlc -c a.mli
dhcp066:
$ocamlc -c a.ml
Fatal error: exception Assert_failure("typing/btype.ml", 202, 26)

If I type the definition of class a interactively, it compiles without
any problem.

Thanks for the report. I've fixed that.
It seems that I was a bit too eager to share types in .cmi files...

Sorry for not using the stable version. I hope the latest cvs
version can do.

Actually the bug was already in 3.06.
Which had lots of problems with polymorphic methods.
The people will have to wait for 3.07...

Jacques

@vicuna
Copy link
Author

vicuna commented Jun 26, 2003

Comment author: administrator

Fixed by JG 2003-06-25

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

No branches or pull requests

1 participant