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
Assertion failure with refutation pattern #7381
Comments
Comment author: @yallop Here's a similar example without a refutation pattern that causes the same assertion failure: type (,) eql = Refl : ('a, 'a) eql |
Comment author: @garrigue Fixed in 4.04 by commit babad14. The problem is that the new exhaustiveness check means that we may have to type GADT constructors even when they do not appear in the patterns themselves. |
Comment author: @nojb We are experiencing some regression due to commit babad14. The affected code in question uses object types and type constrains extensively and we are now seeing "Self type cannot escape its class" errors. I am trying to produce a small example, but have not had any luck yet. I am posting this just to get the word out. |
Comment author: @nojb Unfortunately, it does not. I will be looking at this today and will try to get back with more information/an example. |
Comment author: @nojb Small repro: class virtual child1 parent = class virtual child2 = let _ = Error: The method parent has type < child : 'a; previous : 'b option > |
Comment author: @garrigue I see. A workaround for this example is to move the inner object outside, so that its parameter is generalized: let _ = |
Original bug ID: 7381
Reporter: @yallop
Assigned to: @garrigue
Status: resolved (set by @garrigue on 2016-10-08T11:12:56Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 4.04.0 +dev / +beta1 / +beta2
Target version: undecided
Fixed in version: 4.04.0 +dev / +beta1 / +beta2
Category: typing
Related to: #7298 #7391
Monitored by: @gasche
Bug description
In 4.04.0+beta2:
type (_, _) eql = Refl : ('a, 'a) eql
let f : type t. (int, t) eql * (t, string) eql -> unit = function _ -> .
Fatal error: exception File "typing/env.ml", line 1271, characters 59-65: Assertion failed
The text was updated successfully, but these errors were encountered: