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

regression in type inference with 4.04.0+beta2 #7401

Closed
vicuna opened this issue Nov 4, 2016 · 3 comments
Closed

regression in type inference with 4.04.0+beta2 #7401

vicuna opened this issue Nov 4, 2016 · 3 comments
Assignees
Milestone

Comments

@vicuna
Copy link

vicuna commented Nov 4, 2016

Original bug ID: 7401
Reporter: @c-cube
Assigned to: @garrigue
Status: closed (set by @garrigue on 2016-12-10T02:01:01Z)
Resolution: duplicate
Priority: normal
Severity: minor
Target version: 4.05.0 +dev/beta1/beta2/beta3/rc1
Category: typing
Duplicate of: #7313
Related to: #6752
Monitored by: @yallop

Bug description

A package that builds normally on 4.01, 4.02, 4.03 fails on 4.04.0+beta2 as follows:

# Error: The implementation src/core/Transform.ml
# [...]
#        ...
#        In module Features:
#        Values do not match:
#          val update_l : (key * '_a) list -> '_a M.t -> '_a M.t
#        is not included in
#          val update_l : (key * value) list -> t -> t
#        File "src/core/Transform.ml", line 58, characters 6-14:
#          Actual declaration

This is quite simple code, but it appears that, in the .ml file, the inferred type contains '_a variables that would later be bound to concrete types thanks to the .mli.

Steps to reproduce

opam sw 4.04.0+beta2
wget https://github.com/nunchaku-inria/nunchaku/archive/0.3.tar.gz
tar xvf 0.3.tar.gz
cd nunchaku-0.3
opam install ocamlfind containers sequence menhir
./configure --disable-random
make

should lead to this error.

Additional information

discovered in https://travis-ci.org/ocaml/opam-repository/jobs/173265123

@vicuna
Copy link
Author

vicuna commented Nov 4, 2016

Comment author: @gasche

I just reproduced the (failure) behavior from the head of the 4.04 branch.

Looking at the *-marked entries in the Changelog, the one that seems related to is:

@vicuna
Copy link
Author

vicuna commented Nov 4, 2016

Comment author: @damiendoligez

What I believe: the typechecker is now more strict because previous versions were unsound (or are believed to be unsound).

What I know: the new behaviour breaks very few programs and is easy to work around, so I've decided to release without looking for a fix.

@vicuna
Copy link
Author

vicuna commented Dec 10, 2016

Comment author: @garrigue

Indeed, this is a consequence of the stricter typing of submodules.
#7414 is an example of why the previous approach was wrong.
I have some idea for allowing examples where the type can be trivially found in the mli, but it is harder than I thought first.

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