fix: issue with tuple clause

It was not consuming the next case if there was no condition being checked in the clause.
Now it properly always consumes the next clause unless last clause.
This commit is contained in:
microproofs
2023-06-23 12:36:15 -04:00
parent 5362714a63
commit dbfa08a5a7
6 changed files with 50 additions and 5 deletions

View File

@@ -1,15 +1,13 @@
use other.{FFF, GGG}
test thing1() {
let x =
other.FFF
let x = other.FFF
x == FFF
}
test thing2() {
let x =
other.GGG(2)
let x = other.GGG(2)
x == GGG(2)
}

View File

@@ -0,0 +1,13 @@
# This file was generated by Aiken
# You typically do not need to edit this file
[[requirements]]
name = "aiken-lang/stdlib"
version = "main"
source = "github"
[[packages]]
name = "aiken-lang/stdlib"
version = "main"
requirements = []
source = "github"

View File

@@ -0,0 +1,8 @@
name = "aiken-lang/acceptance_test_083"
version = "0.0.0"
description = ""
[[dependencies]]
name = 'aiken-lang/stdlib'
version = 'main'
source = 'github'

View File

@@ -0,0 +1,22 @@
use aiken/list
test tuple_when() {
let items =
[(#"", #"", 50), (#"aa", #"bb", 70)]
let amount = 70
let policy = #"aa"
let filtered =
list.filter(
items,
fn(item) {
when item is {
(token_policy, _, token_amount) ->
amount == token_amount && policy == token_policy
_ -> False
}
},
)
list.length(filtered) > 0
}