You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've just replaced list.push with cons_list to check if it is more efficient, and then got the error:
aiken::fatal::error
Whoops! You found a bug in the Aiken compiler.
Please report this error at https://github.com/aiken-lang/aiken/issues/new.
In your bug report please provide the information below and if possible the code
that produced it.
Operating System: linux
Architecture: x86_64
Version: v1.0.29-alpha+16fb02e
crates/aiken-lang/src/gen_uplc.rs:4517:25
not implemented: MkCons and MkPairData should be handled by an anon function or using [] or ( a, b, .., z).
so...here I am :)
You can reproduce it with this snippet:
use aiken/list
use aiken/builtin
fn buggy(arg: List<Int>) -> List<Int> {
let result =
arg
|> list.foldl([], fn(x, acc) { builtin.cons_list(x, acc) })
result
}
fn not_buggy(arg: List<Int>) -> List<Int> {
let result =
arg
|> list.foldl([], fn(x, acc) { list.push(acc, x) })
result
}
test bug() {
let a =
[1, 2, 3, 4, 5]
not_buggy(a) == buggy(a)
}
The text was updated successfully, but these errors were encountered:
The bracket operators are simply the cons_list under the hood. There is a type conversion that is necessary so that's why I blocked the builtin for now.
While this builtin is readily available through the Aiken syntax
`[head, ..tail]`, there's no reason to not support its builtin form
even though we may not encourage its usage. For completeness and to
avoid bad surprises, it is now supported.
Fixes#964.
I've just replaced
list.push
withcons_list
to check if it is more efficient, and then got the error:so...here I am :)
You can reproduce it with this snippet:
The text was updated successfully, but these errors were encountered: