The code below prints:
I'm not guilty.
If you uncomment the line marked unleash me, it prints:
I'm guilty. But you're never going to know. Unless you've messed with time travel.
let
let
admit_guilt = true
end
if @isdefined(admit_guilt)
admit_guilt && println("I'm guilty. But you're never going to know. Unless you've messed with time travel.")
else
println("I'm not guilty.")
if false # code inside this block never executes
println("a secret never spilled")
# admit_guilt = true #---------------- unleash me
end
end
end
It reminds me of this #5148 (comment) , but I think there, the inner functions are getting pulled out and getting defined in the global scope (maybe?). I'm not sure what's going on here.