Skip to content

Commit

Permalink
Merge branch 'hkust-taco:mlscript' into optional-arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
noordahx authored Nov 18, 2024
2 parents e31661e + a7504bb commit e390512
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion shared/src/main/scala/mlscript/NewParser.scala
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ abstract class NewParser(origin: Origin, tokens: Ls[Stroken -> Loc], newDefs: Bo
consume
if (tparams.nonEmpty) err(msg"Unsupported type parameters on 'let' binding" -> S(l1) :: Nil)
val rest = expr(0)
R(Let(isLetRec.getOrElse(die), v, body, rest).withLoc(S(l0 ++ annotatedBody.toLoc)))
R(Let(isLetRec.getOrElse(die), v, annotatedBody, rest).withLoc(S(l0 ++ annotatedBody.toLoc)))
case _ =>
R(NuFunDef(
isLetRec, v, opStr, tparams, L(ps.foldRight(annotatedBody)((i, acc) => Lam(i, acc)))
Expand Down
7 changes: 7 additions & 0 deletions shared/src/test/diff/nu/Ascription.mls
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,10 @@ foo(123:Int):Int
//│ Code generation encountered an error:
//│ unresolved symbol Int

fun foo(f) =
let g = (x => f(x)): forall 'a : 'a -> 'a in g(123)
//│ fun foo: (??a -> ??a0) -> 123

fun foo(f) =
let g: forall 'a : 'a -> 'a = x => f(x) in g(123)
//│ fun foo: (??a -> ??a0) -> 123

0 comments on commit e390512

Please sign in to comment.