You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 5619 Reporter:@lpw25 Assigned to:@garrigue Status: closed (set by @garrigue on 2012-05-25T05:22:19Z) Resolution: fixed Priority: low Severity: crash Fixed in version: 4.00.0+dev Category: ~DO NOT USE (was: OCaml general) Related to:#5545#6123 Monitored by:@lpw25 mehdi
Bug description
Compiling the following code produces an uncaught CType.Unify exception:
exception Bad_cast
class type foo_t =
object
method foo: string
end
type 'a name =
Foo: foo_t name
| Int: int name
class foo: foo_t =
object(self)
method foo = "foo"
method cast: type a. a name -> a =
function
Foo -> (self :> foo_t)
| _ -> ((raise Bad_cast) : a)
end
I am using revision 12464 from the repository.
I know that this code is not valid. The original code used my "open types" extension, but I had to remove those bits to show that the bug was not in my extension.
The bug could be avoided in my original code by changing (self :> foo_t) to (self : #foo_t :> foo_t).
Duplicating the environment for GADT pattern matching resulted in wrong detection of self-escape.
Solved by not copying the argument to the dummy_method in subst.ml, under specific conditions.
Fixed in trunk and 4.00, at revisions 12482 and 12483.
Original bug ID: 5619
Reporter: @lpw25
Assigned to: @garrigue
Status: closed (set by @garrigue on 2012-05-25T05:22:19Z)
Resolution: fixed
Priority: low
Severity: crash
Fixed in version: 4.00.0+dev
Category: ~DO NOT USE (was: OCaml general)
Related to: #5545 #6123
Monitored by: @lpw25 mehdi
Bug description
Compiling the following code produces an uncaught CType.Unify exception:
exception Bad_cast
class type foo_t =
object
method foo: string
end
type 'a name =
Foo: foo_t name
| Int: int name
class foo: foo_t =
object(self)
method foo = "foo"
method cast: type a. a name -> a =
function
Foo -> (self :> foo_t)
| _ -> ((raise Bad_cast) : a)
end
I am using revision 12464 from the repository.
I know that this code is not valid. The original code used my "open types" extension, but I had to remove those bits to show that the bug was not in my extension.
The bug could be avoided in my original code by changing (self :> foo_t) to (self : #foo_t :> foo_t).
File attachments
The text was updated successfully, but these errors were encountered: