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

Treat let-module expressions as non-expansive where possible #4838

Closed
vicuna opened this issue Jul 20, 2009 · 1 comment

Comments

Projects
None yet
2 participants
@vicuna
Copy link

commented Jul 20, 2009

Original bug ID: 4838
Reporter: @yallop
Assigned to: @garrigue
Status: closed (set by @garrigue on 2012-06-01T07:24:03Z)
Resolution: fixed
Priority: normal
Severity: feature
Version: 3.11.1
Fixed in version: 4.00.0+dev
Category: ~DO NOT USE (was: OCaml general)
Related to: #4511
Monitored by: till "Julien Signoles" @yallop @hcarty

Bug description

Expressions of the form

let module M = in e

are currently always treated as expansive by the type checker. As a result, in the following declaration "id" is given a non-polymorphic type:

let id = let module M = struct end in fun x -> x

(There are, of course, useful examples as well, particularly where the module expression declares types.)

It seems that many such expressions (including all those where the module-expr is built from non-expansive terms) could be safely treated as non-expansive, increasing the number of typeable programs.

Additional information

Patch against 3.11.1 attached.

File attachments

@vicuna

This comment has been minimized.

Copy link
Author

commented Jun 1, 2012

Comment author: @garrigue

Fixed in trunk and 4.00, revisions 12535, 12536.
The code was already there for first-class modules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.