Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optional args #183

Closed
Closed
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
20d1fa9
adding optional flag to FldFlags
mbroughani81 Sep 11, 2023
0316ade
lexing ? char in args NewLexer
mbroughani81 Sep 12, 2023
3b036b3
show parser debug in test
mbroughani81 Sep 12, 2023
5bd9365
fix in parsing
mbroughani81 Sep 13, 2023
a2ad510
delete redundant prints
mbroughani81 Sep 13, 2023
4e795d2
add opt field in Field node, and parse correctly
mbroughani81 Sep 19, 2023
e6e4ae3
add opt field for FieldType
mbroughani81 Sep 19, 2023
fec99d8
adding opt field for FieldType
mbroughani81 Sep 20, 2023
0a653b2
fix typing of funparams
mbroughani81 Sep 20, 2023
723a9a5
WIP Add helpful test cases
LPTK Sep 22, 2023
5f5fdfd
fix type show
mbroughani81 Sep 23, 2023
d8a8ed4
add subtype check for subtyping with <:<
mbroughani81 Sep 23, 2023
b432dc4
add 2 other field size member checks
mbroughani81 Sep 25, 2023
ed45749
fix problem in field type show
mbroughani81 Sep 26, 2023
ea729b5
add some debugs
mbroughani81 Sep 26, 2023
1819d25
debug the place error happens
mbroughani81 Sep 27, 2023
b924f80
fix operations defined on FieldType
mbroughani81 Sep 28, 2023
6f7a599
Merge branch 'new-definition-typing' into optional-args
mbroughani81 Sep 28, 2023
4a6c2e7
add new require for intersection
mbroughani81 Sep 28, 2023
b81c5b4
Fix minor things in test
mbroughani81 Sep 28, 2023
e511ce1
Add isSubtype for TupleTypes
mbroughani81 Sep 28, 2023
33fc41f
Add error flag for some tests
mbroughani81 Sep 28, 2023
79a51a0
Delete some extra debugs
mbroughani81 Sep 28, 2023
a190864
Delete some extra debugs
mbroughani81 Sep 28, 2023
e882b7c
Delete some extra debugs
mbroughani81 Sep 28, 2023
01ddc66
Fix some possible? bugs
mbroughani81 Sep 28, 2023
8383e09
Delete extra log in DiffTests
mbroughani81 Sep 28, 2023
27bfae9
Fix some possible future? bugs
mbroughani81 Sep 28, 2023
a136b37
Fix some possible future? bugs
mbroughani81 Sep 28, 2023
12b3dc5
Fix some possible future? bugs
mbroughani81 Sep 28, 2023
e2df709
Rename fields compatible checker
mbroughani81 Sep 29, 2023
35442de
Merge branch 'new-definition-typing' into optional-args
mbroughani81 Sep 29, 2023
5c6f3c5
Fix syntax problem in helper
mbroughani81 Sep 29, 2023
a92fc4e
Fix syntax errors
mbroughani81 Sep 29, 2023
0b43e89
Merge branch 'new-definition-typing' into optional-args
LPTK Sep 29, 2023
31b3edd
Add some notes
mbroughani81 Sep 30, 2023
b299e54
Using composed type instead of field opt
mbroughani81 Oct 2, 2023
25d7764
Revert to opt + show bracketed
mbroughani81 Oct 2, 2023
59814ac
.
mbroughani81 Oct 3, 2023
028a5b5
Add ascribing for pattern match on optional fields
mbroughani81 Oct 3, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
show parser debug in test
mbroughani81 committed Sep 12, 2023
commit 3b036b346c88edf1e8dd1b17d6b1c1ea80fa2b32
180 changes: 148 additions & 32 deletions shared/src/test/diff/nu/OptionalArgs.mls
Original file line number Diff line number Diff line change
@@ -3,12 +3,136 @@

// TODO: there is problem when the is SPACE after '?'

:p
:dp
fun f1(a?: Int, b?: Int) = a + b
//│ tokens here => List((KEYWORD(fun),Loc(0,3,nu/OptionalArgs:+7)), (SPACE,Loc(3,4,nu/OptionalArgs:+7)), (IDENT(f1,false),Loc(4,6,nu/OptionalArgs:+7)), (BRACKETS(Round,List((IDENT(a,false),Loc(7,8,nu/OptionalArgs:+7)), (IDENT(?,true),Loc(8,8,nu/OptionalArgs:+7)), (KEYWORD(:),Loc(9,10,nu/OptionalArgs:+7)), (SPACE,Loc(10,11,nu/OptionalArgs:+7)), (IDENT(Int,false),Loc(11,14,nu/OptionalArgs:+7)), (COMMA,Loc(14,15,nu/OptionalArgs:+7)), (SPACE,Loc(15,16,nu/OptionalArgs:+7)), (IDENT(b,false),Loc(16,17,nu/OptionalArgs:+7)), (IDENT(?,true),Loc(17,17,nu/OptionalArgs:+7)), (KEYWORD(:),Loc(18,19,nu/OptionalArgs:+7)), (SPACE,Loc(19,20,nu/OptionalArgs:+7)), (IDENT(Int,false),Loc(20,23,nu/OptionalArgs:+7)))),Loc(6,24,nu/OptionalArgs:+7)), (SPACE,Loc(24,25,nu/OptionalArgs:+7)), (KEYWORD(=),Loc(25,26,nu/OptionalArgs:+7)), (SPACE,Loc(26,27,nu/OptionalArgs:+7)), (IDENT(a,false),Loc(27,28,nu/OptionalArgs:+7)), (SPACE,Loc(28,29,nu/OptionalArgs:+7)), (IDENT(+,true),Loc(29,30,nu/OptionalArgs:+7)), (SPACE,Loc(30,31,nu/OptionalArgs:+7)), (IDENT(b,false),Loc(31,32,nu/OptionalArgs:+7)))
//│ printtokens? |#fun| |f1|(|a|?|#:| |Int|,| |b|?|#:| |Int|)| |#=| |a| |+| |b|
//│ |#fun| |f1|(|a|?|#:| |Int|,| |b|?|#:| |Int|)| |#=| |a| |+| |b|
//│ AST: TypingUnit(NuFunDef(None, f1, [], App(App(Var(+), Tup(_: Var(a))), Tup(_: Var(b)))))
//│ At MM
//│ ? block inspects |#fun| |f1|(|a|?|#:| |Int|,| |b|?|#:| |Int|)| |... [at l.301]
//│ ? go inspects |#fun| |f1|(|a|?|#:| |Int|,| |b|?|#:| |Int|)| |... [at l.270]
//│ ? go inspects |#fun| |f1|(|a|?|#:| |Int|,| |b|?|#:| |Int|)| |... [at l.270]
//│ At MM2
//│ ! t consumes |#fun| [at l.416]
//│ ? yeetSpaces inspects | |f1|(|a|?|#:| |Int|,| |b|?|#:| |Int|)| |#=|... [at l.527]
//│ ! yeetSpaces consumes | | [at l.527]
//│ ? yeetSpaces inspects |f1|(|a|?|#:| |Int|,| |b|?|#:| |Int|)| |#=| |... [at l.527]
//│ ! x$29 consumes |f1| [at l.427]
//│ foundErr => false true
//│ ? yeetSpaces inspects |(|a|?|#:| |Int|,| |b|?|#:| |Int|)| |#=| |a|... [at l.527]
//│ HERE1
//│ ? yeetSpaces inspects |(|a|?|#:| |Int|,| |b|?|#:| |Int|)| |#=| |a|... [at l.527]
//│ @ funParams(()) [at l.469]
//│ │ ? yeetSpaces inspects |(|a|?|#:| |Int|,| |b|?|#:| |Int|)| |#=| |a|... [at l.527]
//│ │ ! res consumes |(|a|?|#:| |Int|,| |b|?|#:| |Int|)| [at l.538]
//│ │ > ? maybeIndented inspects |a|?|#:| |Int|... [at l.1013]
//│ │ > @ argsOrIf(List(),List()) [at l.1056]
//│ │ > │ ? argsOrIf inspects |a|?|#:| |Int|... [at l.1057]
//│ │ > │ ? yeetSpaces inspects |a|?|#:| |Int|... [at l.527]
//│ │ > │ ? yeetSpaces inspects |a|?|#:| |Int|... [at l.527]
//│ │ > │ ? yeetSpaces inspects |a|?|#:| |Int|... [at l.527]
//│ │ > │ good! (IDENT(a,false),Loc(7,8,nu/OptionalArgs:+7)) (IDENT(?,true),Loc(8,8,nu/OptionalArgs:+7)) (KEYWORD(:),Loc(9,10,nu/OptionalArgs:+7))
//│ │ > │ ? yeetSpaces inspects |a|?|#:| |Int|... [at l.527]
//│ │ > │ ! x$60 consumes |a| [at l.1095]
//│ │ > │ ! x$60 consumes |?| [at l.1096]
//│ │ > │ ! x$60 consumes |#:| [at l.1097]
//│ │ > │ case #3
//│ │ > │ flags => None None Some(Loc(8,8,nu/OptionalArgs:+7))
//│ │ > │ @ exprOrIf(1,true) [at l.1109]
//│ │ > │ │ ? exprOrIf inspects | |Int|,| |b|... [at l.571]
//│ │ > │ │ ! exprOrIf consumes | | [at l.573]
//│ │ > │ │ @ exprOrIf(1,true) [at l.574]
//│ │ > │ │ │ ? exprOrIf inspects |Int|,| |b|?|... [at l.571]
//│ │ > │ │ │ ! exprOrIf consumes |Int| [at l.590]
//│ │ > │ │ │ @ exprCont(1,`Int`,false) [at l.591]
//│ │ > │ │ │ │ ? exprCont inspects |,| |b|?|#:|... [at l.747]
//│ │ > │ │ │ = Right(Int)
//│ │ > │ │ = Right(Int)
//│ │ > │ = Right(Int)
//│ │ > │ ? argsOrIf inspects |,| |b|?|#:|... [at l.1117]
//│ │ > │ ! argsOrIf consumes |,| [at l.1123]
//│ │ > │ @ argsOrIf(List((Some(a),Right(Fld(FldFlags(false,false,true),Int)))),List()) [at l.1056]
//│ │ > │ │ ? argsOrIf inspects | |b|?|#:| |... [at l.1057]
//│ │ > │ │ ! argsOrIf consumes | | [at l.1066]
//│ │ > │ │ @ argsOrIf(List((Some(a),Right(Fld(FldFlags(false,false,true),Int)))),List()) [at l.1056]
//│ │ > │ │ │ ? argsOrIf inspects |b|?|#:| |Int| [at l.1057]
//│ │ > │ │ │ ? yeetSpaces inspects |b|?|#:| |Int| [at l.527]
//│ │ > │ │ │ ? yeetSpaces inspects |b|?|#:| |Int| [at l.527]
//│ │ > │ │ │ ? yeetSpaces inspects |b|?|#:| |Int| [at l.527]
//│ │ > │ │ │ good! (IDENT(b,false),Loc(16,17,nu/OptionalArgs:+7)) (IDENT(?,true),Loc(17,17,nu/OptionalArgs:+7)) (KEYWORD(:),Loc(18,19,nu/OptionalArgs:+7))
//│ │ > │ │ │ ? yeetSpaces inspects |b|?|#:| |Int| [at l.527]
//│ │ > │ │ │ ! x$60 consumes |b| [at l.1095]
//│ │ > │ │ │ ! x$60 consumes |?| [at l.1096]
//│ │ > │ │ │ ! x$60 consumes |#:| [at l.1097]
//│ │ > │ │ │ case #3
//│ │ > │ │ │ flags => None None Some(Loc(17,17,nu/OptionalArgs:+7))
//│ │ > │ │ │ @ exprOrIf(1,true) [at l.1109]
//│ │ > │ │ │ │ ? exprOrIf inspects | |Int| [at l.571]
//│ │ > │ │ │ │ ! exprOrIf consumes | | [at l.573]
//│ │ > │ │ │ │ @ exprOrIf(1,true) [at l.574]
//│ │ > │ │ │ │ │ ? exprOrIf inspects |Int| [at l.571]
//│ │ > │ │ │ │ │ ! exprOrIf consumes |Int| [at l.590]
//│ │ > │ │ │ │ │ @ exprCont(1,`Int`,false) [at l.591]
//│ │ > │ │ │ │ │ │ ? exprCont inspects || [at l.747]
//│ │ > │ │ │ │ │ = Right(Int)
//│ │ > │ │ │ │ = Right(Int)
//│ │ > │ │ │ = Right(Int)
//│ │ > │ │ │ ? argsOrIf inspects || [at l.1117]
//│ │ > │ │ = List((Some(a),Right(Fld(FldFlags(false,false,true),Int))), (Some(b),Right(Fld(FldFlags(false,false,true),Int))))
//│ │ > │ = List((Some(a),Right(Fld(FldFlags(false,false,true),Int))), (Some(b),Right(Fld(FldFlags(false,false,true),Int))))
//│ │ > = List((Some(a),Right(Fld(FldFlags(false,false,true),Int))), (Some(b),Right(Fld(FldFlags(false,false,true),Int))))
//│ │ > ? concludeWith inspects || [at l.86]
//│ │ > Concluded with List((Some(a),Fld(FldFlags(false,false,true),Int)), (Some(b),Fld(FldFlags(false,false,true),Int)))
//│ │ Okkkkk as => List((Some(a),Fld(FldFlags(false,false,true),Int)), (Some(b),Fld(FldFlags(false,false,true),Int)))
//│ │ @ funParams(()) [at l.541]
//│ │ │ ? yeetSpaces inspects | |#=| |a| |... [at l.527]
//│ │ │ ! yeetSpaces consumes | | [at l.527]
//│ │ │ Here, creating the params! List()
//│ │ = List()
//│ │ Here, creating the params! List(a: Int, b: Int,) Tup(a: Var(Int), b: Var(Int))
//│ = List(a: Int, b: Int,)
//│ head => List((Some(a),Fld(FldFlags(false,false,true),Int)), (Some(b),Fld(FldFlags(false,false,true),Int)))
//│ case 2List(a: Int, b: Int,)
//│ @ funParams(()) [at l.475]
//│ │ ? yeetSpaces inspects |#=| |a| |+|... [at l.527]
//│ │ Here, creating the params! List()
//│ = List()
//│ ps and transformBody => List() None
//│ ? yeetSpaces inspects |#=| |a| |+|... [at l.527]
//│ ? yeetSpaces inspects |#=| |a| |+|... [at l.527]
//│ ! t consumes |#=| [at l.487]
//│ @ expr(0,true) [at l.488]
//│ │ @ exprOrIf(0,true) [at l.559]
//│ │ │ ? exprOrIf inspects | |a| |+| |... [at l.571]
//│ │ │ ! exprOrIf consumes | | [at l.573]
//│ │ │ @ exprOrIf(0,true) [at l.574]
//│ │ │ │ ? exprOrIf inspects |a| |+| |b| [at l.571]
//│ │ │ │ ! exprOrIf consumes |a| [at l.590]
//│ │ │ │ @ exprCont(0,`a`,false) [at l.591]
//│ │ │ │ │ ? exprCont inspects | |+| |b| [at l.747]
//│ │ │ │ │ ! exprCont consumes | | [at l.791]
//│ │ │ │ │ @ exprCont(0,`a`,false) [at l.792]
//│ │ │ │ │ │ ? exprCont inspects |+| |b| [at l.747]
//│ │ │ │ │ │ ! exprCont consumes |+| [at l.756]
//│ │ │ │ │ │ @ exprOrIf(18,true) [at l.759]
//│ │ │ │ │ │ │ ? exprOrIf inspects | |b| [at l.571]
//│ │ │ │ │ │ │ ! exprOrIf consumes | | [at l.573]
//│ │ │ │ │ │ │ @ exprOrIf(18,true) [at l.574]
//│ │ │ │ │ │ │ │ ? exprOrIf inspects |b| [at l.571]
//│ │ │ │ │ │ │ │ ! exprOrIf consumes |b| [at l.590]
//│ │ │ │ │ │ │ │ @ exprCont(18,`b`,false) [at l.591]
//│ │ │ │ │ │ │ │ │ ? exprCont inspects || [at l.747]
//│ │ │ │ │ │ │ │ = Right(b)
//│ │ │ │ │ │ │ = Right(b)
//│ │ │ │ │ │ = Right(b)
//│ │ │ │ │ │ @ exprCont(0,`+ (a,) (b,)`,false) [at l.763]
//│ │ │ │ │ │ │ ? exprCont inspects || [at l.747]
//│ │ │ │ │ │ = Right(+ (a,) (b,))
//│ │ │ │ │ = Right(+ (a,) (b,))
//│ │ │ │ = Right(+ (a,) (b,))
//│ │ │ = Right(+ (a,) (b,))
//│ │ = Right(+ (a,) (b,))
//│ = + (a,) (b,)
//│ ? yeetSpaces inspects || [at l.527]
//│ ? parseAll inspects || [at l.75]
//│ Parsed: fun f1 = + (a,) (b,);
//│ ╔══[ERROR] identifier not found: a
//│ ║ l.7: fun f1(a?: Int, b?: Int) = a + b
@@ -24,72 +148,64 @@ fun f1(a?: Int, b?: Int) = a + b
// using space, creates ASC in AST.
:p
fun f1(a: Int, b: Int) = a + b
//│ tokens here => List((KEYWORD(fun),Loc(0,3,nu/OptionalArgs:+26)), (SPACE,Loc(3,4,nu/OptionalArgs:+26)), (IDENT(f1,false),Loc(4,6,nu/OptionalArgs:+26)), (BRACKETS(Round,List((IDENT(a,false),Loc(7,8,nu/OptionalArgs:+26)), (KEYWORD(:),Loc(8,9,nu/OptionalArgs:+26)), (SPACE,Loc(9,10,nu/OptionalArgs:+26)), (IDENT(Int,false),Loc(10,13,nu/OptionalArgs:+26)), (COMMA,Loc(13,14,nu/OptionalArgs:+26)), (SPACE,Loc(14,15,nu/OptionalArgs:+26)), (IDENT(b,false),Loc(15,16,nu/OptionalArgs:+26)), (KEYWORD(:),Loc(16,17,nu/OptionalArgs:+26)), (SPACE,Loc(17,18,nu/OptionalArgs:+26)), (IDENT(Int,false),Loc(18,21,nu/OptionalArgs:+26)))),Loc(6,22,nu/OptionalArgs:+26)), (SPACE,Loc(22,23,nu/OptionalArgs:+26)), (KEYWORD(=),Loc(23,24,nu/OptionalArgs:+26)), (SPACE,Loc(24,25,nu/OptionalArgs:+26)), (IDENT(a,false),Loc(25,26,nu/OptionalArgs:+26)), (SPACE,Loc(26,27,nu/OptionalArgs:+26)), (IDENT(+,true),Loc(27,28,nu/OptionalArgs:+26)), (SPACE,Loc(28,29,nu/OptionalArgs:+26)), (IDENT(b,false),Loc(29,30,nu/OptionalArgs:+26)))
//│ printtokens? |#fun| |f1|(|a|#:| |Int|,| |b|#:| |Int|)| |#=| |a| |+| |b|
//│ |#fun| |f1|(|a|#:| |Int|,| |b|#:| |Int|)| |#=| |a| |+| |b|
//│ AST: TypingUnit(NuFunDef(None, f1, [], App(App(Var(+), Tup(_: Var(a))), Tup(_: Var(b)))))
//│ Parsed: fun f1 = + (a,) (b,);
//│ ╔══[ERROR] identifier not found: a
//│ ║ l.26: fun f1(a: Int, b: Int) = a + b
//│ ╙── ^
//│ ║ l.150: fun f1(a: Int, b: Int) = a + b
//│ ╙── ^
//│ ╔══[ERROR] identifier not found: b
//│ ║ l.26: fun f1(a: Int, b: Int) = a + b
//│ ╙── ^
//│ ║ l.150: fun f1(a: Int, b: Int) = a + b
//│ ╙── ^
//│ fun f1: Int
//│ Code generation encountered an error:
//│ unresolved symbol a

f1(1, 2)
//│ tokens here => List((IDENT(f1,false),Loc(0,2,nu/OptionalArgs:+42)), (BRACKETS(Round,List((LITVAL(1),Loc(3,4,nu/OptionalArgs:+42)), (COMMA,Loc(4,5,nu/OptionalArgs:+42)), (SPACE,Loc(5,6,nu/OptionalArgs:+42)), (LITVAL(2),Loc(6,7,nu/OptionalArgs:+42)))),Loc(2,8,nu/OptionalArgs:+42)))
//│ printtokens? |f1|(|1|,| |2|)|
//│ ╔══[ERROR] Type mismatch in application:
//│ ║ l.42: f1(1, 2)
//│ ║ ^^^^^^^^
//│ ║ l.164: f1(1, 2)
//│ ║ ^^^^^^^^
//│ ╟── operator application of type `Int` is not a function
//│ ║ l.26: fun f1(a: Int, b: Int) = a + b
//│ ║ ^^^^^
//│ ║ l.150: fun f1(a: Int, b: Int) = a + b
//│ ║ ^^^^^
//│ ╟── but it flows into reference with expected type `(1, 2,) -> ?a`
//│ ║ l.42: f1(1, 2)
//│ ╙── ^^
//│ ║ l.164: f1(1, 2)
//│ ╙── ^^
//│ error
//│ res
//│ Runtime error:
//│ ReferenceError: f11 is not defined

:p
fun f1(a, b) = a + b
//│ tokens here => List((KEYWORD(fun),Loc(0,3,nu/OptionalArgs:+60)), (SPACE,Loc(3,4,nu/OptionalArgs:+60)), (IDENT(f1,false),Loc(4,6,nu/OptionalArgs:+60)), (BRACKETS(Round,List((IDENT(a,false),Loc(7,8,nu/OptionalArgs:+60)), (COMMA,Loc(8,9,nu/OptionalArgs:+60)), (SPACE,Loc(9,10,nu/OptionalArgs:+60)), (IDENT(b,false),Loc(10,11,nu/OptionalArgs:+60)))),Loc(6,12,nu/OptionalArgs:+60)), (SPACE,Loc(12,13,nu/OptionalArgs:+60)), (KEYWORD(=),Loc(13,14,nu/OptionalArgs:+60)), (SPACE,Loc(14,15,nu/OptionalArgs:+60)), (IDENT(a,false),Loc(15,16,nu/OptionalArgs:+60)), (SPACE,Loc(16,17,nu/OptionalArgs:+60)), (IDENT(+,true),Loc(17,18,nu/OptionalArgs:+60)), (SPACE,Loc(18,19,nu/OptionalArgs:+60)), (IDENT(b,false),Loc(19,20,nu/OptionalArgs:+60)))
//│ printtokens? |#fun| |f1|(|a|,| |b|)| |#=| |a| |+| |b|
//│ |#fun| |f1|(|a|,| |b|)| |#=| |a| |+| |b|
//│ AST: TypingUnit(NuFunDef(None, f1, [], App(App(Var(+), Tup(_: Var(a))), Tup(_: Var(b)))))
//│ Parsed: fun f1 = + (a,) (b,);
//│ ╔══[ERROR] identifier not found: a
//│ ║ l.60: fun f1(a, b) = a + b
//│ ╙── ^
//│ ║ l.180: fun f1(a, b) = a + b
//│ ╙── ^
//│ ╔══[ERROR] identifier not found: b
//│ ║ l.60: fun f1(a, b) = a + b
//│ ╙── ^
//│ ║ l.180: fun f1(a, b) = a + b
//│ ╙── ^
//│ fun f1: Int
//│ Code generation encountered an error:
//│ unresolved symbol a


:p
f1(1, 2)
//│ tokens here => List((IDENT(f1,false),Loc(0,2,nu/OptionalArgs:+78)), (BRACKETS(Round,List((LITVAL(1),Loc(3,4,nu/OptionalArgs:+78)), (COMMA,Loc(4,5,nu/OptionalArgs:+78)), (SPACE,Loc(5,6,nu/OptionalArgs:+78)), (LITVAL(2),Loc(6,7,nu/OptionalArgs:+78)))),Loc(2,8,nu/OptionalArgs:+78)))
//│ printtokens? |f1|(|1|,| |2|)|
//│ |f1|(|1|,| |2|)|
//│ AST: TypingUnit(App(Var(f1), Tup(_: IntLit(1), _: IntLit(2))))
//│ Parsed: f1 (1, 2,);
//│ ╔══[ERROR] Type mismatch in application:
//│ ║ l.78: f1(1, 2)
//│ ║ ^^^^^^^^
//│ ║ l.196: f1(1, 2)
//│ ║ ^^^^^^^^
//│ ╟── operator application of type `Int` is not a function
//│ ║ l.60: fun f1(a, b) = a + b
//│ ║ ^^^^^
//│ ║ l.180: fun f1(a, b) = a + b
//│ ║ ^^^^^
//│ ╟── but it flows into reference with expected type `(1, 2,) -> ?a`
//│ ║ l.78: f1(1, 2)
//│ ╙── ^^
//│ ║ l.196: f1(1, 2)
//│ ╙── ^^
//│ error
//│ res
//│ Runtime error: