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: 6158 Reporter:@yallop Assigned to:@garrigue Status: closed (set by @xavierleroy on 2015-12-11T18:24:06Z) Resolution: fixed Priority: normal Severity: minor Version: 4.01.0+beta/+rc Fixed in version: 4.01.0+dev Category: typing
Bug description
The following code should be rejected but triggers an internal error:
$ cat vars.ml
type 'a t = T of 'a
type 'a s = S of 'a
type (_, _) eq = Refl : ('a, 'a) eq
let f : (int s, int t) eq -> unit = function
| Refl -> ()
$ ocamlc vars.ml
Fatal error: types should not include variables
Fatal error: exception Misc.Fatal_error
A similar example with well-typed code gives the same error:
module M (S : sig
type 'a t = T of 'a
type 'a s = T of 'a
end) =
struct
let f : ('a S.s, 'a S.t) eq -> unit = function
| Refl -> ()
end
$ ocamlc vars2.ml
Fatal error: types should not include variables
Fatal error: exception Misc.Fatal_error
The text was updated successfully, but these errors were encountered:
Indeed, the incompatibility check is more clever than before, but as a result it may be called on type definitions containing variables. No need to fail in that case.
Keep this PR open, as there is a minor side-problem, as the non-principal typechecker may leave reified variables in exported types. They are detected and report when using -principal.
While it would be better to do that without -principal too, this has no impact on soundness.
Original bug ID: 6158
Reporter: @yallop
Assigned to: @garrigue
Status: closed (set by @xavierleroy on 2015-12-11T18:24:06Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 4.01.0+beta/+rc
Fixed in version: 4.01.0+dev
Category: typing
Bug description
The following code should be rejected but triggers an internal error:
$ cat vars.ml
type 'a t = T of 'a
type 'a s = S of 'a
type (_, _) eq = Refl : ('a, 'a) eq
let f : (int s, int t) eq -> unit = function
| Refl -> ()
$ ocamlc vars.ml
A similar example with well-typed code gives the same error:
$ cat vars2.ml
type (_, _) eq = Refl : ('a, 'a) eq
module M (S : sig
type 'a t = T of 'a
type 'a s = T of 'a
end) =
struct
let f : ('a S.s, 'a S.t) eq -> unit = function
| Refl -> ()
end
$ ocamlc vars2.ml
The text was updated successfully, but these errors were encountered: