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

Code may fail to type without -strict-sequence #7130

Closed
vicuna opened this issue Jan 28, 2016 · 1 comment
Closed

Code may fail to type without -strict-sequence #7130

vicuna opened this issue Jan 28, 2016 · 1 comment
Assignees

Comments

@vicuna
Copy link

vicuna commented Jan 28, 2016

Original bug ID: 7130
Reporter: berke.durak
Assigned to: @garrigue
Status: resolved (set by @garrigue on 2017-03-15T06:07:41Z)
Resolution: not a bug
Priority: low
Severity: minor
Platform: x86_64
OS: Linux
OS Version: Debian (jessie)
Version: 4.02.2
Target version: later
Category: typing

Bug description

One generally expects that if code compiles with stricter options, it will also compile with more lax options, but this is not the case with -strict-sequence.

Steps to reproduce

% ocaml
OCaml version 4.02.2

class bar = object method foo f = f (); 123 end;;

Error: Some type variables are unbound in this type:
class bar : object method foo : (unit -> 'a) -> int end
The method foo has type (unit -> 'a) -> int where 'a is unbound

% ocaml -strict-sequence
OCaml version 4.02.2

class bar = object method foo f = f (); 123 end;;

class bar : object method foo : (unit -> unit) -> int end

@vicuna
Copy link
Author

vicuna commented Mar 15, 2017

Comment author: @garrigue

Type inference for type classes is not principal.
In particular, it may be necessary to restrict some types for a program to be accepted.
So this situation is no surprise.

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