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

compiler fails with Stack overflow #6907

vicuna opened this issue Jun 17, 2015 · 1 comment

compiler fails with Stack overflow #6907

vicuna opened this issue Jun 17, 2015 · 1 comment


Copy link

@vicuna vicuna commented Jun 17, 2015

Original bug ID: 6907
Reporter: @ivg
Assigned to: @garrigue
Status: closed (set by @xavierleroy on 2017-02-16T14:14:48Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 4.02.1
Target version: 4.03.0+dev / +beta1
Fixed in version: 4.03.0+dev / +beta1
Category: typing
Monitored by: @ivg

Bug description

On the following code, compiler fails with "Fatal error: exception Stack overflow"

class type ['e] t = object('s)
method update : 'e -> 's

module type S = sig
class base : 'e -> ['e] t
(* ^^^^^^
missed type parameters *)

Steps to reproduce

$ ocamlc

Additional information

The bug is reproducible on at least 4.02.2 and 4.02.1. I didn't try on older versions.

The category is chosen based on an educated guess. I have no real witness, that it is from type checker, other then the error occurs on both ocamlc, ocaml, ocamlopt and even merlin.

Also, when minimizing an example, I've figured out, that the trigger is the return type of update method. If I change update return type to unit for example, the error will not show itself.

File attachments

Copy link

@vicuna vicuna commented Oct 16, 2015

Comment author: @garrigue

Fixed in trunk at revision 16513.
Forgot to mark loops in the type...

@vicuna vicuna closed this as completed Feb 16, 2017
@vicuna vicuna added the typing label Mar 14, 2019
@vicuna vicuna added this to the 4.03.0 milestone Mar 14, 2019
@vicuna vicuna added the bug label Mar 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

2 participants