Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006388OCaml~DO NOT USE (was: OCaml general)public2014-05-01 20:152015-12-11 19:27
Assigned Tofrisch 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version4.02.0+dev 
Summary0006388: Error messages for 1-tuples are confusing
DescriptionIf I construct an 1-tuple directly via AST, e.g. with `Ast_helper.Exp.tuple [a]`, the error message from typechecker is as follows:

Error: This expression has type int but an expression was expected of type int

Also, the pretty-printer prints it as an expression, which doesn't help.

I think the Pprintast should be extended to print 1-tuples (and perhaps 0-tuples?) in a special way; if I did not know exactly what the bug were, I would have spent hours figuring it out.
TagsNo tags attached.
Attached Files

- Relationships
related to 0006424closedfrisch 0-ary function application miscompiles and segfaults ocamlrun 

-  Notes
frisch (developer)
2014-05-02 14:58

Instead of adapting the printer, I think it would make more sense to check in the type-checker the invariants which are normally enforced by the parser, but could be broken if one uses -pp/-ppx processors.
frisch (developer)
2014-06-03 14:36

Commit 14949 in 4.02 checks that tuples have at least 2 elements. (Please shout if you have a legitimate use of "unary tuples" in generated code.) The same commit adds some more invariant checks.

- Issue History
Date Modified Username Field Change
2014-05-01 20:15 whitequark New Issue
2014-05-02 14:58 frisch Note Added: 0011339
2014-05-30 12:37 shinwell Relationship added related to 0006424
2014-05-30 12:38 shinwell Status new => acknowledged
2014-06-03 14:36 frisch Note Added: 0011637
2014-06-03 14:37 frisch Status acknowledged => resolved
2014-06-03 14:37 frisch Fixed in Version => 4.02.0+dev
2014-06-03 14:37 frisch Resolution open => fixed
2014-06-03 14:37 frisch Assigned To => frisch
2015-12-11 19:27 xleroy Status resolved => closed
2017-02-23 16:36 doligez Category OCaml general => -OCaml general
2017-03-03 17:55 doligez Category -OCaml general => -(deprecated) general
2017-03-03 18:01 doligez Category -(deprecated) general => ~deprecated (was: OCaml general)
2017-03-06 17:04 doligez Category ~deprecated (was: OCaml general) => ~DO NOT USE (was: OCaml general)

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker