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

Shadowing a variable by a different type fails in a module in OCaml 4.01 #5608

Closed
vicuna opened this issue May 7, 2012 · 5 comments
Closed
Assignees

Comments

@vicuna
Copy link

vicuna commented May 7, 2012

Original bug ID: 5608
Reporter: furuse
Assigned to: @garrigue
Status: closed (set by @garrigue on 2012-05-14T02:10:37Z)
Resolution: fixed
Priority: high
Severity: major
Fixed in version: 4.00.0+dev
Category: ~DO NOT USE (was: OCaml general)
Monitored by: furuse

Bug description

The following program is rejected by ocaml 4.01.0+dev2 (2012-04-17):

module X = struct
let x = 1
let x = 1.0
end

The compiler says:

module X = struct
let x = 1
let x = 1.0
end

The compiler says:

File "/tmp/x.ml", line 1:
Error: The implementation //toplevel//
does not match the interface (inferred signature):
In module X:
Modules do not match:
sig val x : int val x : float end
is not included in
sig val x : int val x : float end
In module X:
Values do not match: val x : float is not included in val x : int
File "/tmp/x.ml", line 2, characters 6-7: Expected declaration
File "/tmp/x.ml", line 3, characters 6-7: Actual declaration

@vicuna
Copy link
Author

vicuna commented May 7, 2012

Comment author: @garrigue

I cannot reproduce with the current version of trunk (revision 12433).
What is your revision number?

@vicuna
Copy link
Author

vicuna commented May 7, 2012

Comment author: furuse

It is 12410.

@vicuna
Copy link
Author

vicuna commented May 8, 2012

Comment author: @garrigue

I still cannot reproduce, but I have fixed a similar problem in the toplevel.
Please try with the current version (revision 12440).

@vicuna
Copy link
Author

vicuna commented May 14, 2012

Comment author: furuse

Verified the problem is gone in the latest svn. Please close this.

@vicuna
Copy link
Author

vicuna commented May 14, 2012

Comment author: @garrigue

This was apparently related to the toplevel issue fixed by commit 12440.

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