Merge pull request #438 from Kindelia/experimental

fix: problem with duplication of arity error message
This commit is contained in:
Felipe G 2022-12-15 14:38:53 -03:00 committed by GitHub
commit 57d7631df8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 23 additions and 4 deletions

View File

@ -136,13 +136,13 @@ impl<'a> DesugarState<'a> {
self.desugar_destruct(
next.range,
binding,
res_val,
res_val.clone(),
&|this| this.desugar_expr(next),
&|this, name| {
desugared::Expr::let_(
range,
name.clone(),
this.desugar_expr(val),
res_val.clone(),
this.desugar_expr(next),
)
},

View File

@ -124,13 +124,13 @@ impl<'a> DesugarState<'a> {
self.desugar_destruct(
next.range,
destruct,
res_val,
res_val.clone(),
&|this| this.desugar_sttm(bind_ident, pure_ident, next),
&|this, ident| {
desugared::Expr::let_(
destruct.locate(),
ident.clone(),
this.desugar_expr(val),
res_val.clone(),
this.desugar_sttm(bind_ident, pure_ident, next),
)
},

View File

@ -0,0 +1,12 @@
ERROR Incorrect arity.
/--[suite/issues/checker/ArityOnLet.kind2:6:13]
|
5 | ArityOnLet =
6 | let a = A
| v
| \This function requires a fixed number of arguments
7 | 2
Hint: This function expects 1 arguments but got 0

View File

@ -0,0 +1,7 @@
A (n : U60) : U60
A n = n
ArityOnLet : U60
ArityOnLet =
let a = A
2