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: 6440 Reporter: labichn Assigned to:@diml Status: closed (set by @diml on 2014-05-23T16:43:58Z) Resolution: fixed Priority: normal Severity: minor Platform: x86_64 OS: GNU/Linux OS Version: 3.14.4-1-ARCH Version: 4.01.0 Category: -for Camlp4 use https://github.com/ocaml/camlp4/issues Monitored by:@gasche
Bug description
There seems to be inconsistent behavior involving the "-pp" flag of ocamlc. Under some conditions with polymorphic variants and private row types, using the "-pp" flag (as opposed to first running caml4p and then ocamlc) causes an incorrect error.
Steps to reproduce
cat garrigue.ml # attached to the bug report
(* example modified from Garrigue, J.--APLAS '06 *)
module type Ops = sig
type expr
val eval : expr -> expr
val show : expr -> string
end
module Test = struct
type 'a expr0 = [Num of int | True]
module F(X : Ops with type expr = private [> 'a expr0] as 'a) =
struct
type expr = X.expr expr0
let eval : expr -> X.expr = function
| True -> True
| Num _ as e -> e let show : expr -> string = function | Num n -> string_of_int n
| True -> "true" end module rec L : (Ops with type expr = L.expr expr0) = F(L) end let _ = Printf.printf "%s\n" (Test.L.show(True)) ;;
wget http://caml.inria.fr/pub/distrib/ocaml-4.01/ocaml-4.01.0.tar.gz
tar -xf ocaml-4.01.0.tar.gz
cd ocaml-4.01.0.tar.gz
./configure --prefix $PWD/local && make world.opt && make install
...
cd ..
./ocaml-4.01.0/local/bin/ocamlc -pp "./ocaml-4.01.0/local/bin/camlp4o" garrigue.ml
File "garrigue.ml", line 14, characters 8-13:
Error: This pattern matches values of type [? True ] but a pattern was expected which matches values of type expr The second variant type does not allow tag(s) True
./ocaml-4.01.0/local/bin/camlp4o garrigue.ml > pp_garrigue.ml
./ocaml-4.01.0/local/bin/ocamlc pp_garrigue.ml
./a.out
true
Additional information
It only seems to occur if the pv constructor has no arguments; if you remove `True from the type and the relevant cases from the functions, there is no issue. This issue seems to be present in 3.12.1, 4.01.0, and the current latest on github (as of May 22nd @ 15:00).
Original bug ID: 6440
Reporter: labichn
Assigned to: @diml
Status: closed (set by @diml on 2014-05-23T16:43:58Z)
Resolution: fixed
Priority: normal
Severity: minor
Platform: x86_64
OS: GNU/Linux
OS Version: 3.14.4-1-ARCH
Version: 4.01.0
Category: -for Camlp4 use https://github.com/ocaml/camlp4/issues
Monitored by: @gasche
Bug description
There seems to be inconsistent behavior involving the "-pp" flag of ocamlc. Under some conditions with polymorphic variants and private row types, using the "-pp" flag (as opposed to first running caml4p and then ocamlc) causes an incorrect error.
Steps to reproduce
Additional information
It only seems to occur if the pv constructor has no arguments; if you remove `True from the type and the relevant cases from the functions, there is no issue. This issue seems to be present in 3.12.1, 4.01.0, and the current latest on github (as of May 22nd @ 15:00).
File attachments
The text was updated successfully, but these errors were encountered: