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
A private method of a top-level make block can be called from outside it #780
A method in a private do block of a make is rejected when called from outside the block, if the make is inside a module (KEXET-0489). For a make at the top level of the file, the same call checks clean and runs.
record User do
name : String
end
make User do
let label -> String = secret
private do
let secret -> String = @name
end
end
main do
IO.printLine(User { name: "Ada" }.secret)
end
kex -C says No errors found., and kex -R prints Ada. Wrapping the record and the make in module Accounts do ... end gives the expected error:
example.kex:14:16: [KEXET-0489]: Error, `secret` is private to `make Accounts.User` in `Accounts`. It is only callable inside that block
Expected: KEXET-0488 for the top-level case. #281 fixed this for make blocks in modules.
Seen on kex 0.4.0-rc.4 built from main at 371bbdf. Found while writing explanations for oops.kex.run.
Activity