Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005728OCaml~DO NOT USE (was: OCaml general)public2012-08-16 09:102016-12-07 14:41
Reporterfuruse 
Assigned To 
PrioritynormalSeverityfeatureReproducibilityalways
StatusclosedResolutionwon't fix 
PlatformOSOS Version
Product Version4.00.0 
Target VersionFixed in Version 
Summary0005728: Better handling of unary tuple type
DescriptionPlaying with compiler-libs, I found that it is now rather easy to create an unary tuple value Parsetree node and it is typable with a strange unary tuple type.

Of course it is the user's responsibility not to create such strange AST nodes, but I think the compiler can provide some help by explicitly rejecting the typing of unary tuples.

BTW, the type error message related with this unary tuple type looks very cryptic:

  Error: This expression has type 'a but an expression was expected of type
           string

Here 'a is not a simple Tvar but something to be printed like Tuple('a), which is not unifiable with string.
TagsNo tags attached.
Attached Files

- Relationships
related to 0005811closedfrisch Untypeast produces singleton tuples for constructor patterns with only one argument 

-  Notes
(0016710)
shinwell (developer)
2016-12-07 14:41

I think it is unfortunately the programmer's responsibility to get this sort of thing right. There has been some suggestion of trying to write a better interface to Parsetree (in particular for the purposes of increasing the maintainability of ppx code). This sort of thing could probably be cleaned up at the same time.

- Issue History
Date Modified Username Field Change
2012-08-16 09:10 furuse New Issue
2012-09-06 16:43 doligez Target Version => 4.00.1+dev
2012-09-28 09:50 doligez Severity minor => feature
2012-09-28 09:50 doligez Status new => acknowledged
2012-09-28 09:50 doligez Target Version 4.00.1+dev =>
2012-11-06 13:41 gasche Relationship added related to 0005811
2016-12-07 14:41 shinwell Note Added: 0016710
2016-12-07 14:41 shinwell Status acknowledged => closed
2016-12-07 14:41 shinwell Resolution open => won't fix
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