Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005523OCamlOCaml typingpublic2012-03-06 17:292014-09-04 00:25
Reporterfrisch 
Assigned Togarrigue 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusassignedResolutionopen 
PlatformOSOS Version
Product Version 
Target VersionundecidedFixed in Version 
Summary0005523: Improve "this ground coercion is not principal" warning message
DescriptionIt would be useful if the type-checker could report the inferred type for the sub-expression when a coercion is detected as being non-principal. It would make it simpler to copy and paste this type to the source code in order to make the coercion principal.
Tagspatch
Attached Filesdiff file icon patch_warnings_formatter.diff [^] (9,988 bytes) 2012-03-07 10:21 [Show Content]

- Relationships

-  Notes
(0007015)
garrigue (manager)
2012-03-07 08:02

This makes sense, but there is an unfortunate difficulty:
warnings are strings, whereas printing a type requires a formatter.
Of course one can input a type to a string, but the layout may not
be as expected.
(0007017)
frisch (developer)
2012-03-07 09:37

What about turning Warnings.message into a printer
(with a formatter argument), and using the standard trick to count the number of printed lines (i.e. redirecting the "newline" method of the formatter; should probably be done in Location.print_warning, by the way)?
(0007019)
frisch (developer)
2012-03-07 10:22

Proposal attached. I don't fully understand the logic for line counting, so I may have missed something.

- Issue History
Date Modified Username Field Change
2012-03-06 17:29 frisch New Issue
2012-03-07 08:02 garrigue Note Added: 0007015
2012-03-07 08:02 garrigue Assigned To => garrigue
2012-03-07 08:02 garrigue Status new => assigned
2012-03-07 09:37 frisch Note Added: 0007017
2012-03-07 10:21 frisch File Added: patch_warnings_formatter.diff
2012-03-07 10:22 frisch Note Added: 0007019
2012-07-10 11:31 doligez Target Version => 4.01.0+dev
2012-07-31 13:36 doligez Target Version 4.01.0+dev => 4.00.1+dev
2012-09-21 12:47 doligez Target Version 4.00.1+dev => 4.01.0+dev
2013-08-14 09:21 doligez Target Version 4.01.0+dev => 4.01.1+dev
2013-12-05 15:31 doligez Tag Attached: patch
2014-05-25 20:20 doligez Target Version 4.01.1+dev => 4.02.0+dev
2014-08-18 20:40 doligez Target Version 4.02.0+dev => 4.02.1+dev
2014-09-04 00:25 doligez Target Version 4.02.1+dev => undecided


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker