| Anonymous | Login | Signup for a new account | 2013-06-19 20:45 CEST | ![]() |
| Main | My View | View Issues | Change Log | Roadmap |
| View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||
| ID | Project | Category | View Status | Date Submitted | Last Update | |||
| 0004705 | OCaml | Camlp4 | public | 2009-01-31 01:31 | 2012-09-25 20:06 | |||
| Reporter | Martin Jambon | |||||||
| Assigned To | xclerc | |||||||
| Priority | normal | Severity | minor | Reproducibility | always | |||
| Status | closed | Resolution | fixed | |||||
| Platform | OS | OS Version | ||||||
| Product Version | 3.11.0 | |||||||
| Target Version | Fixed in Version | 3.12.1+dev | ||||||
| Summary | 0004705: Can't define types with `True or `False | |||||||
| 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. | |||||||
| Tags | No tags attached. | |||||||
| Attached Files | ||||||||
Issue History |
|||
| Date Modified | Username | Field | Change |
| 2009-01-31 01:31 | Martin Jambon | New Issue | |
| 2009-03-28 17:18 | xleroy | Status | new => assigned |
| 2009-03-28 17:18 | xleroy | Assigned To | => ertai |
| 2011-09-05 15:38 | xclerc | Assigned To | ertai => xclerc |
| 2011-09-05 15:39 | xclerc | Status | assigned => resolved |
| 2011-09-05 15:39 | xclerc | Fixed in Version | => 3.12.1+dev |
| 2011-09-05 15:39 | xclerc | Resolution | open => fixed |
| 2012-09-25 20:06 | xleroy | Status | resolved => closed |
| Copyright © 2000 - 2011 MantisBT Group |