Copy link
@jnthn

jnthn Apr 3, 2022

Member

I don't think this is correct; the RakuAST::Block of the package body is a lexical scope, and the one that the declarations should be introduced into. This way, we end up with an extra level of lexical scope (and it will be a real problem, because for example in roles the ::?CLASS lexical must be a parameter of the body block).

There are other places where a block's exact behavior is adjusted by its parent (see apply-implicit-block-semantics), and that, or some generalization of it, would be better.