This for sure is a serious bug. I have recorded it for now.On Tuesday, April 21, 2015 at 8:11:09 AM UTC-4, Kiwamu Okabe wrote:
Hi all,
I found an odd behavior of matching unbox tuple.
Why does following code match @(1, 1) but not @(1, 0)?
$ cat test.dats
fun match (a:int, b:int):void =
case+ @(a, b) of
| @(1, 1) => println! “11”
| @(1, 0) => println! “10”
| _ => println! “**”
implement main0 () = {
val () = match (1, 1)
val () = match (1, 0)
val () = match (0, 1)
val () = match (0, 0)
}
$ patscc test.dats
$ ./a.out
11
**
**
**
This bug has been fixed. I am quite surprised that this bug did not surface
much earlier.
The changes have been uploaded and will go into the next release of ATS2
(ATS2-0.1.11).
Cheers!On Tuesday, April 21, 2015 at 10:42:58 AM UTC-4, gmhwxi wrote:
Thanks!
This for sure is a serious bug. I have recorded it for now.
On Tuesday, April 21, 2015 at 8:11:09 AM UTC-4, Kiwamu Okabe wrote:
Hi all,
I found an odd behavior of matching unbox tuple.
Why does following code match @(1, 1) but not @(1, 0)?
$ cat test.dats
fun match (a:int, b:int):void =
case+ @(a, b) of
| @(1, 1) => println! “11”
| @(1, 0) => println! “10”
| _ => println! “**”
implement main0 () = {
val () = match (1, 1)
val () = match (1, 0)
val () = match (0, 1)
val () = match (0, 0)
}
$ patscc test.dats
$ ./a.out
11
**
**
**