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

Fatal error: exception File "typing/typeclass.ml", line 294 #7894

Closed
vicuna opened this issue Jan 9, 2019 · 12 comments
Closed

Fatal error: exception File "typing/typeclass.ml", line 294 #7894

vicuna opened this issue Jan 9, 2019 · 12 comments
Assignees

Comments

@vicuna
Copy link

vicuna commented Jan 9, 2019

Original bug ID: 7894
Reporter: wlitwin
Assigned to: @lpw25
Status: assigned (set by @lpw25 on 2019-02-15T10:13:47Z)
Resolution: open
Priority: normal
Severity: crash
Version: 4.07.0
Category: typing
Monitored by: @nojb @gasche

Bug description

OCaml 4.07.0 fails to compile the following program:

class basicWidget app = object(self)
    method invalidate : unit =
        app#redrawWidget self
end

class simple app =
    let label1 = new basicWidget app in
object(self)
    inherit basicWidget app
end

let _ = new simple (object end)

Steps to reproduce

paste the description code into a src file and try building with:

ocamlc file.ml

The following happens:

Fatal error: exception File "typing/typeclass.ml", line 294, characters 12-18: Assertion failed

File attachments

@vicuna
Copy link
Author

vicuna commented Jan 9, 2019

Comment author: wlitwin

Forgot to check trunk, still appears to throw an exception as of commit:

7113629
Date: Tue Jan 8 17:20:42 2019 +0100

$ ./ocamlc --version
4.08.0+dev0-2018-04-09

$ ./ocamlc main.ml
Fatal error: exception File "typing/typeclass.ml", line 302, characters 15-21: Assertion failed

@vicuna
Copy link
Author

vicuna commented Jan 9, 2019

Comment author: @gasche

This appears to be a regression in 4.07.0. Indeed, 4.06.1 prints the following message instead:

File "test.ml", line 10, characters 24-27:
Error: This expression has type < redrawWidget : basicWidget -> unit; .. >
but an expression was expected of type
< redrawWidget : (< invalidate : unit; .. > as 'a) -> unit; .. >
Type basicWidget = < invalidate : unit > is not compatible with type
< invalidate : unit; .. > as 'a
Self type cannot be unified with a closed object type

@vicuna
Copy link
Author

vicuna commented Jan 9, 2019

Comment author: @gasche

I traced the regression back to this commit

"make the dummy method disappear when finalizing a class"
86e1c8a
86e1c8a

@vicuna
Copy link
Author

vicuna commented Jan 10, 2019

Comment author: @trefis

We looked at this yesterday with Leo, and found a couple of other related issues.
Leo is currently working on a fix. (details to follow in a GPR)

@vicuna
Copy link
Author

vicuna commented Feb 19, 2019

Comment author: @garrigue

Is there any progress on this one?
Interactions in the object system are subtle, as this problem has demonstrated.

@vicuna
Copy link
Author

vicuna commented Feb 19, 2019

Comment author: @lpw25

I've got a patch coming that tidies up a fair few things in typeclass.ml and fixes this bug. Should take me a few more days, so assuming no urgent interruptions I should make a PR this week or next.

@github-actions
Copy link

github-actions bot commented May 6, 2020

This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc.

@github-actions github-actions bot added the Stale label May 6, 2020
@trefis
Copy link
Contributor

trefis commented May 6, 2020

IIRC « (details to follow in a GPR) » was a forward reference to #8516 .

@github-actions
Copy link

This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc.

@github-actions github-actions bot added the Stale label May 10, 2021
@trefis trefis removed the Stale label May 10, 2021
@trefis
Copy link
Contributor

trefis commented May 10, 2021

There was some progress on #8516 recently.

@github-actions
Copy link

This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc.

@github-actions github-actions bot added the Stale label May 13, 2022
@trefis
Copy link
Contributor

trefis commented May 13, 2022

This was fixed by #8516: on 4.14 I get the same error message as on 4.06.

@trefis trefis closed this as completed May 13, 2022
@trefis trefis removed the Stale label May 13, 2022
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

3 participants