The goal is to handle this without bothering the code generation down the line. That is, we can handle it when transforming from the untyped AST to the typed one. That's why there's no 'TraceIfFalse' constructor in the typed AST. It has disappeared during type-check.
```
Error:
× Main thread panicked.
├─▶ at crates/uplc/src/optimize.rs:16:68
╰─▶ called `Result::unwrap()` on an `Err` value: FreeUnique(Name { text: "tests_bar", unique: Unique(1) })
```
We want the lookup to yield a result when there's only a single
validator; and no title is provided. So that users can simply do
'aiken address' in their project if it's unambiguous. The validator's
name is only required to disambiguate between multiple validators.
I also noticed that the order of arguments in with_validator was
wrong. Somehow.
**a**
```
× Main thread panicked.
├─▶ at crates/uplc/src/optimize.rs:16:68
╰─▶ called `Result::unwrap()` on an `Err` value: FreeUnique(Name { text: "__other_clauses_delayed", unique: Unique(13) })
```
**b**
```
× Main thread panicked.
├─▶ at crates/aiken-lang/src/builder.rs:771:14
╰─▶ not yet implemented: Assign
```
**c**
```
× choice_4 failed
help: ┍━ left ━━━━━━━━━━━━━┑
│ (con data #d87a80) │
┕━━━━━━━━━━━━━━━━━━━━┙
should be equal to
┍━ right ━━━━━━━━━━━━━━━━━━┑
│ (con data #d8799f182aff) │
┕━━━━━━━━━━━━━━━━━━━━━━━━━━┙
```
Todo is fundamentally just a trace and an error. The only reason we kept it as a separate element in the AST is for the formatter to work out whether it should format something back to a todo or something else.
However, this introduces redundancy in the code internally and makes the AIR more complicated than it needs to be. Both todo and errors can actually be represented as trace + errors, and we only need to record their preferred shape when parsing so that we can format them back to what's expected.
We now parse errors as a combination of a trace plus and error term. This is a baby step in order to simplify the code generation down the line and the internal representation of todo / errors.
This however enforces that the argument unifies to a `String`. So this
is more flexible than the previous form, but does fundamentally the
same thing.
Fixes#378.
Not sure what this special case was trying to achieve, but it's not right. There's no need to handle function call with a single argument differently than the others.
List Clauses patterns handle var cases
Fixed Tuple Clauses issue with last clause not being a tuple
Redid how zero arg functions and dependencies are handled. Tough one lol
Doesn't like var patterns in list pattern-matching
```
Error:
× Main thread panicked.
├─▶ at crates/aiken-lang/src/uplc.rs:770:29
╰─▶ internal error: entered unreachable code
```
```
Error:
× Main thread panicked.
├─▶ at crates/uplc/src/optimize.rs:16:68
╰─▶ called `Result::unwrap()` on an `Err` value: FreeUnique(Name { text: "tests_tx_1", unique:
Unique(14) })
```