Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005410OCamlCamlp4public2011-11-27 10:352012-09-25 20:07
ReporterkyoDralliam 
Assigned Todim 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version3.12.1 
Target VersionFixed in Version3.12.1+dev 
Summary0005410: error in camlp4o when printing class application
DescriptionConsidering the few lines :

$cat a.ml
class my_class (x:int) = object method get () = x end

let foo x y = x + y

class my_other_class = my_class (foo 5 3)



camlp4o has the bad habit to remove the parentheses in the last line when using
the command


$camlp4o a.ml -o b.ml
$ocamlc b.ml
File "b.ml", line 5, characters 32-35:
Error: This expression has type int -> int -> int
       but an expression was expected of type int
$cat b.ml
class my_class (x : int) = object method get = fun () -> x end
  
let foo x y = x + y
  
class my_other_class = my_class foo 5 3


Moreover, there is a hack that allows to keep the wanted meaning :

class other_method () = let z = foo 5 3 in my_class z
class other_method_bis = other_m

Both my_other_class and other_method_bis have the same behavior when the code compile.
Additional InformationDoing the following works fine
$camlp4o a.ml > b.ml
$ocamlc b.ml
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0006444)
dim (developer)
2011-12-21 14:17

Fixed.

Commits 11916 and 11917.

- Issue History
Date Modified Username Field Change
2011-11-27 10:35 kyoDralliam New Issue
2011-11-27 10:35 kyoDralliam Status new => assigned
2011-11-27 10:35 kyoDralliam Assigned To => ertai
2011-12-21 11:49 gasche Assigned To ertai => dim
2011-12-21 14:17 dim Note Added: 0006444
2011-12-21 14:18 dim Status assigned => resolved
2011-12-21 14:18 dim Resolution open => fixed
2011-12-21 14:18 dim Fixed in Version => 3.12.1+dev
2012-09-25 20:07 xleroy Status resolved => closed


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker