You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The easy way to fix this is to fix the code of the pretty_* functions in typing/parmatch.ml. A simple patch is attached that fixes the reported issue.
The good way to fix this, in my opinion, is to have this code not pretty-print a value extrapolated from a pattern, but to extrapolate this value into a valid AST tree, and then call the Pprintast functions to print expressions and handle the ugly details of pretty-printings. Pprintast is not a bug-free zone, but we could at least centralize our pretty-printing bugs in a single place.
Original bug ID: 6680
Reporter: pveber
Assigned to: @garrigue
Status: closed (set by @xavierleroy on 2016-12-07T10:37:05Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 4.02.1
Fixed in version: 4.02.2+dev / +rc1
Category: typing
Bug description
In the following, the counter-example produced by the exhaustivity check is not printed correctly:
let f = function
a (
b 1) -> true;;Warning 8: this pattern-matching is not exhaustive.
Here is an example of a value that is not matched:
a
b 0val f : [<
a of [<
b of int ] ] -> bool =a
b 0 should bea (
b 0)File attachments
The text was updated successfully, but these errors were encountered: