Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

type application in quotations #5080

Closed
vicuna opened this issue Jun 20, 2010 · 8 comments
Closed

type application in quotations #5080

vicuna opened this issue Jun 20, 2010 · 8 comments

Comments

@vicuna
Copy link

vicuna commented Jun 20, 2010

Original bug ID: 5080
Reporter: @glondu
Assigned to: @xclerc
Status: closed (set by @xavierleroy on 2015-12-11T18:04:46Z)
Resolution: fixed
Priority: normal
Severity: major
Version: 3.12.0+beta1 or 3.12.0+rc1
Fixed in version: 4.00.0+dev
Category: -for Camlp4 use https://github.com/ocaml/camlp4/issues
Related to: #5104
Monitored by: "Dmitry Grebeniuk" @ygrek thelema jaked jm @hcarty @Chris00

Bug description

Hello,

The following:

let test x = match x with
| <:ctyp< $a$ $b$ >> -> (a, b)

used to work with camlp4of (3.11.2), but stopped working with 3.12.0+beta1. I'm not sure if this is expected.

ocaml-batteries is affected by this issue... I've not been able to find anything else than using the expanded quotation.

@vicuna
Copy link
Author

vicuna commented Jul 13, 2010

Comment author: jaked

I have the same problem with << $x$ -> unit >>; I get" EOI expected after [quotation of type] (in [quotation of type])". It seems to happen with leading antiquotations.

@vicuna
Copy link
Author

vicuna commented Jul 13, 2010

Comment author: jaked

Maybe not the same bug, but as it is for <:ctyp< >> I'll put it here: for <:ctyp< $lid:id$ : mutable $t$ >> I get "illegal begin of quotation of type".

@vicuna
Copy link
Author

vicuna commented Aug 3, 2010

Comment author: @ygrek

This affects deriving as well. First two cases can be workarounded with extra parentheses :

  •  | `Function (f, t) -> <:ctyp< $expr f$ -> $expr t$ >>
    
  •  | `Function (f, t) -> <:ctyp< ($expr f$ -> $expr t$) >>
    
  •  | [x]   -> <:ctyp< $expr x$ $f$ >>
    
  •  | x::xs -> app (<:ctyp< $expr x$ $f$ >>) xs
    
  •  | [x]   -> <:ctyp< ($expr x$ $f$) >>
    
  •  | x::xs -> app (<:ctyp< ($expr x$ $f$) >>) xs
    

@vicuna
Copy link
Author

vicuna commented Feb 15, 2011

Comment author: @xclerc

The patch proposed for #5104 seems to also solve this issue.

@vicuna
Copy link
Author

vicuna commented Feb 17, 2011

Comment author: @xclerc

Nicolas Pouillard provided me with a cleaner patch that has
been committed in "version/3.12". After some testing, it
seems to both resolve the issue and yield no regression.

Please test it, and re-open the issue if I missed something.

@vicuna
Copy link
Author

vicuna commented Jun 1, 2011

Comment author: @damiendoligez

The current version (3.12.1+dev11) breaks lablgtk with the following error message.

File "gtkSignal.ml4", line 92, characters 10-13:
Parse error: [opt_when_expr] expected after [patt_as_patt_opt] (in [match_case0])

This happens with and without the patch that you (xclerc) provided to me in private.

@vicuna
Copy link
Author

vicuna commented Jun 2, 2011

Comment author: @xclerc

As a first step, I reduce the bug case to:
"let f = function | `INT x -> true | _ -> false"

camlp4of no more accepts polymorphic variants with a parameter.

Investigation continues...

@vicuna
Copy link
Author

vicuna commented Jun 2, 2011

Comment author: @xclerc

OK, my bad.
The problem stems from the dirty hack I set for #4732.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant