[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: regression in example on homepage
- Subject: Re: regression in example on homepage
- From: Ori Bernstein <ori@xxxxxxxxxxxxxx>
- Date: Sun, 13 Dec 2015 21:49:02 -0800
- To: Andrew Chambers <andrewchamberss@xxxxxxxxx>
- Cc: myrddin-dev@xxxxxxxxxxxxxx
That's a compiler bug.
'_' should catch any value of 'a' that isn't 123 or 234, so reporting that
it's matched by an earlier case is wrong.
And, on my machine I get a compiler segfault, so that's definitely a compiler bug.
On Mon, 14 Dec 2015 17:07:12 +1300, Andrew Chambers <andrewchamberss@xxxxxxxxx> wrote:
> Running the examples on the homepage, one has stopped working. Here is the
> minimized failure. It prints 'pattern matched by earlier case' referring
> to the .a patterns.
>
>
> use std
>
> type s = struct
> a : int
> b : (int, int)
> ;;
>
> const main = {
> var v : s
> v = [.a = 123, .b=(5, 10)]
> match v
> | [.a = 234]: std.put("Should not be here\n")
> | [.a = 123, .b=(x, y)]: std.put("tuple is ({}, {})\n", x, y)
> | _: std.put("No matches: Generic case\n")
> ;;
> }
--
Ori Bernstein