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: 5332 Reporter:@diml Status: closed (set by @garrigue on 2011-08-09T14:01:47Z) Resolution: fixed Priority: normal Severity: minor Fixed in version: 3.13.0+dev Category: ~DO NOT USE (was: OCaml general)
Bug description
I was playing with the svn version of ocaml and get the following error:
type ('env, 'a) var =
| Zero : ('a * 'env, 'a) var
| Succ : ('env, 'a) var -> ('b * 'env, 'a) var
type ('env, 'a) typ =
| Tint : ('env, int) typ
| Tbool : ('env, bool) typ
| Tvar : ('env, 'a) var -> ('env, 'a) typ
let f : type env a. (env, a) typ -> (env, a) typ -> int = fun ta tb ->
match ta, tb with
| Tint, Tint -> 0
| Tbool, Tbool -> 1
| Tvar var, tb -> 2
let x = f Tint (Tvar Zero)
Here i get no warning when defining f, and x is evaluated to 0. If i remove the Tbool constructor, then i get a warning and a Match_failure exception.
The text was updated successfully, but these errors were encountered:
Original bug ID: 5332
Reporter: @diml
Status: closed (set by @garrigue on 2011-08-09T14:01:47Z)
Resolution: fixed
Priority: normal
Severity: minor
Fixed in version: 3.13.0+dev
Category: ~DO NOT USE (was: OCaml general)
Bug description
I was playing with the svn version of ocaml and get the following error:
type ('env, 'a) var =
| Zero : ('a * 'env, 'a) var
| Succ : ('env, 'a) var -> ('b * 'env, 'a) var
type ('env, 'a) typ =
| Tint : ('env, int) typ
| Tbool : ('env, bool) typ
| Tvar : ('env, 'a) var -> ('env, 'a) typ
let f : type env a. (env, a) typ -> (env, a) typ -> int = fun ta tb ->
match ta, tb with
| Tint, Tint -> 0
| Tbool, Tbool -> 1
| Tvar var, tb -> 2
let x = f Tint (Tvar Zero)
Here i get no warning when defining f, and x is evaluated to 0. If i remove the Tbool constructor, then i get a warning and a Match_failure exception.
The text was updated successfully, but these errors were encountered: