Fix compilation errors for the newly introduce test & add type inference.

Tests are basically functions for which the return type should unify with bool. In principle, the type checker could also check that a test function has no arguments but, a test function with arguments wouldn't parse in the first place; feels a bit hacky but it works when considering the pipeline as a whole.

  Note that the code generation is still to be done.
This commit is contained in:
KtorZ
2022-12-08 14:45:26 +01:00
committed by rvcas
parent ea48747825
commit bc785673b2
5 changed files with 44 additions and 3 deletions

View File

@@ -11,3 +11,7 @@ pub fn spend(datum: sample.Datum, rdmr: sample.Redeemer, _ctx: Nil) -> Bool {
z == #(#[222], #[222])
}
test foo() {
1 + 1 == 2
}