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

Assert failure in typeclass.ml #5498

Closed
vicuna opened this issue Feb 3, 2012 · 1 comment
Closed

Assert failure in typeclass.ml #5498

vicuna opened this issue Feb 3, 2012 · 1 comment
Assignees

Comments

@vicuna
Copy link

vicuna commented Feb 3, 2012

Original bug ID: 5498
Reporter: @garrigue
Assigned to: @garrigue
Status: closed (set by @garrigue on 2012-02-03T07:04:13Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 3.11.2
Fixed in version: 3.13.0+dev
Category: typing
Related to: #2602

Bug description

Hello Jacques,

I've hit a:
Fatal error: exception Assert_failure("typing/typeclass.ml", 1401, 18)
while adding some objects/classes to llpp[1],

~$ ocamlc -v
The Objective Caml compiler, version 3.11.2

the code that hits this is at
[1] http://repo.or.cz/w/llpp.git

you'd need to remove coercions for it to trigger, for instance

diff --git a/main.ml b/main.ml
index 818a129..047bd65 100644
--- a/main.ml
+++ b/main.ml
@@ -3634,7 +3634,7 @@ let enterinfomode =
if Glut.getModifiers () land Glut.active_ctrl = 0
then
match key with

  •      | Glut.KEY_LEFT  -> coe (self#updownlevel ~-1)
    
  •      | Glut.KEY_LEFT  -> (self#updownlevel ~-1)
        | Glut.KEY_RIGHT -> coe (self#updownlevel 1)
        | _ -> super#special key
      else super#special key
    

--
malc

Steps to reproduce

Download llpp by

git clone git://repo.or.cz/llpp.git

and compile with build.sh

Additional information

Reproduce with 3.12 and trunk too

@vicuna
Copy link
Author

vicuna commented Feb 3, 2012

Comment author: @garrigue

Unification with an empty object did only check the absence of the first method.
As a result incompatible types could be unified, causing errors later.

Fixed in trunk revision 12111 and 3.12 revision 12112.

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