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: 4705 Reporter:@mjambon Assigned to:@xclerc Status: closed (set by @xavierleroy on 2012-09-25T18:06:17Z) Resolution: fixed Priority: normal Severity: minor Version: 3.11.0 Fixed in version: 3.12.1+dev Category: -for Camlp4 use https://github.com/ocaml/camlp4/issues
Bug description
Quotations in the revised syntax do not handle True or False correctly in type definitions. It is very hard to guess since the type definition is processed and compiled without errors. The problems only occur when using the type in question.
Affected versions: 3.10.2, 3.11.0 with camlp4orf
Old Camlp4 3.09.2 works fine on that case.
$ ocamlc -c -pp camlp4orf -I +camlp4 pa_foo.ml
$ ocamlc -c -pp 'camlp4o -parser pa_foo.cmo' foo.ml
File "foo.ml", line 10, characters 1-7:
Error: This expression has type [> False ] but is here used with type foo The second variant type does not allow tag(s) False
So one first workaround is to preprocess files with 'camlp4o -printer o ...'.
Another workaround is to avoid using True or False.
A third workaround is to use quotations in the classic syntax.
The text was updated successfully, but these errors were encountered:
Original bug ID: 4705
Reporter: @mjambon
Assigned to: @xclerc
Status: closed (set by @xavierleroy on 2012-09-25T18:06:17Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 3.11.0
Fixed in version: 3.12.1+dev
Category: -for Camlp4 use https://github.com/ocaml/camlp4/issues
Bug description
Quotations in the revised syntax do not handle
True or
False correctly in type definitions. It is very hard to guess since the type definition is processed and compiled without errors. The problems only occur when using the type in question.Affected versions: 3.10.2, 3.11.0 with camlp4orf
Old Camlp4 3.09.2 works fine on that case.
$ ocamlc -c -pp camlp4orf -I +camlp4 pa_foo.ml
$ ocamlc -c -pp 'camlp4o -parser pa_foo.cmo' foo.ml
File "foo.ml", line 10, characters 1-7:
Error: This expression has type [>
False ] but is here used with type foo The second variant type does not allow tag(s)
False(*
This is pa_foo.ml
ocamlc -c -pp camlp4orf -I +camlp4 pa_foo.ml
*)
open Camlp4.PreCast
open Syntax
EXTEND Gram
GLOBAL: str_item;
str_item: [
[ "FOO" -> <:str_item< type foo = [ = `False ] >> ]
];
END
;;
(*********************************************************)
(*
This is foo.ml
camlp4o -parser pa_foo.cmo -printer o foo.ml
ocamlc -c -pp 'camlp4o -parser pa_foo.cmo' foo.ml
*)
FOO ;;
(`False : foo)
(*********************************************************)
Pretty-printing goes well:
$ camlp4o -parser pa_foo.cmo -printer o foo.ml
(*
This is foo.ml
camlp4o -parser pa_foo.cmo -printer o foo.ml
ocamlc -c -pp 'camlp4o -parser pa_foo.cmo' foo.ml
*)
type foo = [ | `False ]
let _ = (`False : foo)
So one first workaround is to preprocess files with 'camlp4o -printer o ...'.
Another workaround is to avoid using
True or
False.A third workaround is to use quotations in the classic syntax.
The text was updated successfully, but these errors were encountered: