You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
return n is rejected in a -> Integer? function where a final n is accepted #774
In a function declared to return Integer?, the last expression n (an Integer) is accepted, but return n is not.
let viaReturn(text: String) -> Integer? do
let n = Integer.parse(text).try
return n
end
let viaLast(text: String) -> Integer? do
let n = Integer.parse(text).try
n
end
example.kex:3:10: [KEXET-0127]: Error, `viaReturn` declared to return Integer? but body returns Integer
viaLast checks clean and runs. Expected: both accepted, or both rejected. Also, the error is KEXET-0127 ("body returns"), where a wrong return would normally be KEXET-0124.
Seen on kex 0.4.0-rc.4 built from main at 371bbdf, and on 5773911. Found while writing explanations for oops.kex.run.
Activity