aiken-lang / aiken

A modern smart contract platform for Cardano
https://aiken-lang.org
Apache License 2.0
396 stars 82 forks source link

Running to fatal error in and expression #909

Closed t0anh closed 2 months ago

t0anh commented 3 months ago

What Git revision are you using?

Describe what the problem is?

This snippet would result a fatal error

test panic_aiken() {
  and {
    True,
    should_fail(1),
  }
}

fn should_fail(num) {
  expect num == 0
  True
}
// aiken check -m panic_aiken
   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.26-alpha+075668b

   crates/aiken-project/src/test_framework.rs:1148:39

       called `Result::unwrap()` on an `Err` value: ()

Note that the True expression must come first the fail expression to reproduce this error

What should be the expected behavior?

Should return error instead of panic

rvcas commented 3 months ago

cc @MicroProofs I originally thought this was a zero arg function thing but it seems like it's not? Do you know what could be wrong here?