Open aryairani opened 4 years ago
Just ran into this again; here's another sample program in case it helps:
Stream.sum : '{Stream Nat} () -> Nat
Stream.sum =
h : Nat -> Request {Stream Nat} () -> Nat
h acc = cases
{ Stream.emit e -> resume} ->
handle resume () with h (acc + e)
{ u } -> acc
I'm not sure what _150003 means at line 3, columns 3-4
3 | h : Nat -> Request {Stream Nat} () -> Nat
Whatever it is, it has a type that conforms to (.base.() ->{Stream .base.Nat} .base.()) -> .base.Nat.
I was just stumped for a bit on something similar.
While it's less likely to stump people in such a simple form you can get this message with something as simple as:
foo : Nat
foo =
x = 3
y = 4
sum = x + y
I'm not sure what _250003 means at line 5, columns 3-6
5 | sum = x + y
Whatever it is, it has a type that conforms to Nat.
I think that there are two things going on here.
_25003
? Both _25003
and sum
are highlighted red, so the compiler seems to know that it refers to sum
. Are we able to show the user sum
instead of _25003
?sum
as the result of this expression? If so, add sum
on a new line below line 5
."