Skip to content

Commit 42317d5

Browse files
committed
Fix missing annotation
1 parent 5841627 commit 42317d5

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

shared/src/main/scala/mlscript/NewParser.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ abstract class NewParser(origin: Origin, tokens: Ls[Stroken -> Loc], newDefs: Bo
522522
consume
523523
if (tparams.nonEmpty) err(msg"Unsupported type parameters on 'let' binding" -> S(l1) :: Nil)
524524
val rest = expr(0)
525-
R(Let(isLetRec.getOrElse(die), v, body, rest).withLoc(S(l0 ++ annotatedBody.toLoc)))
525+
R(Let(isLetRec.getOrElse(die), v, annotatedBody, rest).withLoc(S(l0 ++ annotatedBody.toLoc)))
526526
case _ =>
527527
R(NuFunDef(
528528
isLetRec, v, opStr, tparams, L(ps.foldRight(annotatedBody)((i, acc) => Lam(i, acc)))

shared/src/test/diff/nu/Ascription.mls

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,10 @@ foo(123:Int):Int
4949
//│ Code generation encountered an error:
5050
//│ unresolved symbol Int
5151

52+
fun foo(f) =
53+
let g = (x => f(x)): forall 'a : 'a -> 'a in g(123)
54+
//│ fun foo: (??a -> ??a0) -> 123
55+
56+
fun foo(f) =
57+
let g: forall 'a : 'a -> 'a = x => f(x) in g(123)
58+
//│ fun foo: (??a -> ??a0) -> 123

0 commit comments

Comments
 (0)