Eigenstate: myrddin-dev mailing list

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: regression in example on homepage


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

Follow-Ups:
Re: regression in example on homepageOri Bernstein <ori@xxxxxxxxxxxxxx>
References:
regression in example on homepageAndrew Chambers <andrewchamberss@xxxxxxxxx>