The main trick here was transforming Assignment to contain Vec<UntypedPattern, Option<Annotation>> in a field called patterns. This then meant that I could remove the pattern and annotation field from Assignment. The parser handles = and <- just fine because in the future = with multi patterns will mean some kind of optimization on tuples. But, since we don't have that optimization yet, when someone uses multi patterns with an = there will be an error returned from the type checker right where infer_seq looks for backpassing. From there the rest of the work was in Project::backpassing where I only needed to rework some things to work with a list of patterns instead of just one.
This is what the new error looks like
This is what is looks like formatted with many args
The main trick here was transforming Assignment to contain
Vec<UntypedPattern, Option<Annotation>>
in a field called patterns. This then meant that I could remove thepattern
andannotation
field fromAssignment
. The parser handles=
and<-
just fine because in the future=
with multi patterns will mean some kind of optimization on tuples. But, since we don't have that optimization yet, when someone uses multi patterns with an=
there will be an error returned from the type checker right whereinfer_seq
looks forbackpassing
. From there the rest of the work was inProject::backpassing
where I only needed to rework some things to work with a list of patterns instead of just one.This is what the new error looks like![CleanShot 2024-03-11 at 19 02 07@2x](https://github.com/aiken-lang/aiken/assets/12070598/d99835c3-f83c-40f8-b93d-15491ed748c4)
This is what is looks like formatted with many args![CleanShot 2024-03-11 at 18 59 26@2x](https://github.com/aiken-lang/aiken/assets/12070598/74a6bfdd-bfa1-49fb-a412-87e6e18946e8)