Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006801OCamltypingpublic2015-03-03 07:292017-02-16 15:14
Reporterggole 
Assigned Togarrigue 
PrioritylowSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version4.02.1 
Target Version4.03.0+dev / +beta1Fixed in Version4.03.0+dev / +beta1 
Summary0006801: Exhaustiveness messages for GADTs suggest patterns that will not type check
DescriptionExhaustiveness messages for GADTs are a bit off. They will suggest patterns need to be inserted for constructors that are not actually legal to insert because they will not type check.

A simple example:

   type _ value =
      | String : string -> string value
      | Float : float -> float value
      | Any

    let print_string_value (x : string value) =
      match x with
      | String s -> print_endline s

The resulting message:

    File "test.ml", line 7, characters 2-46:
    Warning 8: this pattern-matching is not exhaustive.
    Here is an example of a value that is not matched:
    (Float _|Any)

But of course, inserting a pattern for Float _ won't go very well!
TagsNo tags attached.
Attached Files

- Relationships
duplicate of 0006403closedgarrigue another broken GADT exhaustiveness check 
related to 0006437closedgarrigue GADT exhaustiveness check incompleteness 
child of 0005998assignedgarrigue GADT typing and exhaustiveness bugs 

-  Notes
(0013944)
garrigue (manager)
2015-05-18 04:30

See PR#6437 for a patch which solves this problem.
(0014611)
garrigue (manager)
2015-10-23 10:40

Branch gadt-warnings was merged in trunk at revision 16532.

- Issue History
Date Modified Username Field Change
2015-03-03 07:29 ggole New Issue
2015-03-03 21:13 doligez Status new => confirmed
2015-03-03 21:13 doligez Target Version => 4.02.3+dev
2015-04-27 12:27 garrigue Relationship added child of 0005998
2015-04-27 12:29 garrigue Relationship added duplicate of 0006403
2015-05-18 04:29 garrigue Relationship added related to 0006437
2015-05-18 04:30 garrigue Note Added: 0013944
2015-07-10 16:51 doligez Target Version 4.02.3+dev => 4.03.0+dev / +beta1
2015-10-23 10:40 garrigue Note Added: 0014611
2015-10-23 10:40 garrigue Status confirmed => resolved
2015-10-23 10:40 garrigue Fixed in Version => 4.03.0+dev / +beta1
2015-10-23 10:40 garrigue Resolution open => fixed
2015-10-23 10:40 garrigue Assigned To => garrigue
2017-02-16 15:14 xleroy Status resolved => closed
2017-02-23 16:45 doligez Category OCaml typing => typing


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker