rename 'constr_{fields,index}' to 'unconstr_{field,index}'

Better match the conventions so far used across the existing builtins.
This commit is contained in:
KtorZ
2024-12-13 15:18:15 +01:00
parent 977e24c725
commit 67bf64967b
3 changed files with 36 additions and 23 deletions

View File

@@ -1,12 +1,23 @@
use aiken/builtin.{constr_index}
use aiken/builtin.{unconstr_fields, unconstr_index}
test baz() {
test bar() {
let x = Some("bar")
expect [bar] = x |> builtin.constr_fields
expect [bar] = x |> builtin.unconstr_fields
and {
constr_index(x) == 0,
unconstr_index(x) == 0,
builtin.un_b_data(bar) == "bar",
}
}
test baz() {
let x = Some("baz")
expect [baz] = x |> unconstr_fields
and {
builtin.unconstr_index(x) == 0,
builtin.un_b_data(baz) == "baz",
}
}