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
match, loop and next are accepted as function names, then cannot be called #779
Most keywords are rejected as a function name with KEXEP-0001 (while, when, return, break, then). Three get through, and the function they define cannot be called.
let match(n: Integer) -> Integer = n
main do
IO.printLine(match(1))
end
The definition checks clean. The call is read as a match expression:
example.kex:4:24: [KEXEP-0078]: Error, expected 'do' after match subject, got )
let loop(n: Integer) -> Integer = n is accepted the same way.
next behaves differently depending on the form:
let next(n: Integer) -> Integer = n is rejected, but with KEXEP-0124, which says "cannot name a variable".
foul next -> Void = IO.printLine("x") is accepted. Calling it as next gives KEXES-0003: 'next' used outside a loop.
Expected: KEXEP-0001 at the definition for match, loop and next, in every form. Keywords as method names in a make block are allowed on purpose (#508), so this is only about top-level and module functions.
Seen on kex 0.4.0-rc.4 built from main at 371bbdf. Found while writing explanations for oops.kex.run.
Activity