Closed as not planned
Closed as not planned
Description
For example,
fn foo() {}
fn f1() {
fn bar() {
foo(); // This resolves to the item
}
let foo = 0;
}
fn f2() {
let foo = 0;
fn bar() {
foo(); // This is an error (cannot capture dynamic environment in a fn item)
}
}
Since items in a block are above the block's local variables in the scope hierarchy, it might make sense to resolve the items' bodies in scopes that descend directly from the scope of the block's items, bypassing the scopes of the local variables.
That being said, I think I prefer the current behavior. However, since it will mildly complicate name resolution in the future, I wanted to make sure that we actually want this behavior.