@@ -134,36 +134,22 @@ fun foo(x) = if x is
134
134
//│ foo: (Pair & {snd: nothing} & 'a) -> ("ones" | "zeros" | 'a)
135
135
//│ = [Function: foo5]
136
136
137
- // Note: the parser produces a wrong syntax tree.
138
- :p
139
137
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]
154
140
155
141
fun foo(x, y) = if x is
156
142
Z() and y is O() then 0 else 1
157
143
//│ ╔══[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
159
145
//│ ╙── ^^^^
160
146
//│ foo: (Z, O,) -> 0
161
- //│ = [Function: foo6 ]
147
+ //│ = [Function: foo7 ]
162
148
163
149
fun foo(x, y) =
164
150
if x is
165
151
Z() and y is O() then 0
166
152
else 1
167
153
//│ foo: (anything, anything,) -> (0 | 1)
168
- //│ = [Function: foo7 ]
154
+ //│ = [Function: foo8 ]
169
155
0 commit comments