Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0003957OCamlOCaml generalpublic2006-01-20 16:132013-07-12 18:15
Reporteralexbaretta 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusacknowledgedResolutionopen 
PlatformOSOS Version
Product Version 
Target Version4.01.1+devFixed in Version 
Summary0003957: [> {typexpr} as 't ] yields a syntax error with yacc syntax
Descriptionroot@alex:~# ledit ocaml
        Objective Caml version 3.09.1+dev5 (2005-12-05)

# type 'a foo = [ `Foo of 'a ];;
type 'a foo = [ `Foo of 'a ]
# let x : [> 'x foo as 'x] option = None;;
Syntax error
# #load "camlp4o.cma";;
        Camlp4 Parsing version 3.09.1+dev5 (2005-12-05)

# let x : [> 'x foo as 'x] option = None;;
val x : [> ('a foo as 'a) foo ] option = None
Additional InformationThe problem is hardly significant, as the camlp4 based parsers easily allow to overcome it.
TagsNo tags attached.
Attached Files

- Relationships
related to 0003835closed Camlp4 accepts illegal (?) code 

-  Notes
(0003519)
mauny (developer)
2006-01-23 18:59

Seems that camlp4 conforms to the spec. Similar to issue 0003835.
(0009672)
doligez (administrator)
2013-07-02 16:17
edited on: 2013-07-02 16:19

Looking at the 4.01 version of the documentation, it is indeed slightly incomplete because it is not "typexpr" that is allowed here, but a restricted subset. The solution is general: add parentheses to make the parser happy:

# let x : [> ('x foo as 'x) ] option = None;;
val x : [> ('a foo as 'a) foo ] option = None

Note: there are other constructs with the same kind of problem. In the future, we may make the documentation more precise, but I don't see this as a high-priority task.


- Issue History
Date Modified Username Field Change
2006-01-20 16:13 alexbaretta New Issue
2006-01-23 18:57 mauny Relationship added related to 0003835
2006-01-23 18:59 mauny Note Added: 0003519
2006-03-29 16:34 doligez Status new => acknowledged
2006-03-29 16:34 doligez Category Caml-light => OCaml general
2012-07-11 16:46 doligez Target Version => 4.01.0+dev
2012-07-31 13:37 doligez Target Version 4.01.0+dev => 4.00.1+dev
2012-09-11 14:18 doligez Target Version 4.00.1+dev => 4.00.2+dev
2013-07-02 16:17 doligez Note Added: 0009672
2013-07-02 16:18 doligez Target Version 4.00.2+dev => 4.02.0+dev
2013-07-02 16:19 doligez Note Edited: 0009672 View Revisions
2013-07-12 18:15 doligez Target Version 4.02.0+dev => 4.01.1+dev


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker