Home My Page Projects Code Snippets Project Openings SML/NJ Bugs
Summary Activity Tracker Lists

[#130] failure to raise Bind exception

Date:
2014-11-24 22:44
Priority:
3
State:
Closed
Submitted by:
Bug Submitter (webuser)
Assigned to:
David MacQueen (dbm)
Machine Architecture:
None
Operating System:
Generic Unix
Component:
Compiler
Resolution:
Fixed
Severity:
Minor
OS Version:
OS X 10.10
SML/NJ Version:
110.77
Keywords:
pattern matching, let binding
URL:
Transcript (of reproduction):
- let val (x :: y) = nil in 3 end; val it = 3 : int - let val (_ :: _) = nil in 3 end; uncaught exception Bind [nonexhaustive binding failure] raised at: stdIn:3.9-3.23 -
Source (for reproduction):
let val (x :: y) = nil in 3 end; let val (_ :: _) = nil in 3 end;
Summary:
failure to raise Bind exception

Detailed description
A non-exhaustive let-binding pattern with non matching definiens
should raise a Bind exception at runtime. In the example it does
not do so. A similar example with variables replaced by wildcard
patterns will raise Bind.

Additional comments:
Premature optimization or simplification of let binding code
where no variables are bound?


Submitted via web form by David MacQueen dmacqueen@mac.com

Comments:

Message  ↓
Date: 2019-10-13 00:02
Sender: David MacQueen

Fixed by DBM, 10/12/19 for 110.94. Fix is to not generalize types for val declarations in the lhs pattern is refutable. The refutable test is conservative in that it does not yet deal with refutability of OR patterns (which is the same problem as the exhaustiveness check for matches that is performed by the match compiler.

Attached Files:

Changes

Field Old Value Date By
status_idOpen2019-10-13 00:03dbm
close_dateNone2019-10-13 00:03dbm
ResolutionAccepted As Bug2019-10-13 00:02dbm
detailsA non-exhaustive let-binding pattern with non matching definiens should raise a Bind exception at runtime. In the example it does not do so. A similar example with variables replaced by wildcard patterns will raise Bind. Additional comments: Premature optimization or simplification of let binding code where no variables are bound? Submitted via web form by David MacQueen dmacqueen@mac.com 2017-05-01 20:10jhr
ResolutionNone2017-05-01 20:10jhr
assigned_tonone2014-11-25 21:40dbm