Skip to content

Commit 7fa00ff

Browse files
committed
Rectify a false positive
1 parent 787e69d commit 7fa00ff

File tree

1 file changed

+5
-19
lines changed

1 file changed

+5
-19
lines changed

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

+5-19
Original file line numberDiff line numberDiff line change
@@ -134,36 +134,22 @@ fun foo(x) = if x is
134134
//│ foo: (Pair & {snd: nothing} & 'a) -> ("ones" | "zeros" | 'a)
135135
//│ = [Function: foo5]
136136

137-
// Note: the parser produces a wrong syntax tree.
138-
:p
139137
fun foo(x, y) = if x is Z() and y is O() then 0 else 1
140-
//│ |#fun| |foo|(|x|,| |y|)| |#=| |#if| |x| |is| |Z|(||)| |and| |y| |is| |O|(||)| |#then| |0| |#else| |1|
141-
//│ Parsed: fun foo = x, y, => if x is Z () and y is (O ()) then 0 else 1;
142-
//│ Desugared: rec def foo: x, y, => if x is Z () and y is (O ()) then 0 else 1
143-
//│ /!!!\ Uncaught error: scala.NotImplementedError: an implementation is missing
144-
//│ at: scala.Predef$.$qmark$qmark$qmark(Predef.scala:344)
145-
//│ at: mlscript.Typer.$anonfun$typeTerm$2(Typer.scala:626)
146-
//│ at: mlscript.TyperHelpers.trace(TyperHelpers.scala:30)
147-
//│ at: mlscript.Typer.typeTerm(Typer.scala:744)
148-
//│ at: mlscript.Typer.$anonfun$typeTerm$2(Typer.scala:714)
149-
//│ at: mlscript.TyperHelpers.trace(TyperHelpers.scala:30)
150-
//│ at: mlscript.Typer.typeTerm(Typer.scala:744)
151-
//│ at: mlscript.Typer.$anonfun$typeTerm$2(Typer.scala:733)
152-
//│ at: mlscript.TyperHelpers.trace(TyperHelpers.scala:30)
153-
//│ at: mlscript.Typer.typeTerm(Typer.scala:744)
138+
//│ foo: (anything, anything,) -> (0 | 1)
139+
//│ = [Function: foo6]
154140

155141
fun foo(x, y) = if x is
156142
Z() and y is O() then 0 else 1
157143
//│ ╔══[PARSE ERROR] Unexpected 'else' keyword here
158-
//│ ║ l.156: Z() and y is O() then 0 else 1
144+
//│ ║ l.196: Z() and y is O() then 0 else 1
159145
//│ ╙── ^^^^
160146
//│ foo: (Z, O,) -> 0
161-
//│ = [Function: foo6]
147+
//│ = [Function: foo7]
162148

163149
fun foo(x, y) =
164150
if x is
165151
Z() and y is O() then 0
166152
else 1
167153
//│ foo: (anything, anything,) -> (0 | 1)
168-
//│ = [Function: foo7]
154+
//│ = [Function: foo8]
169155

0 commit comments

Comments
 (0)