Comment #0 by default_357-line — 2022-11-02T12:55:07Z
Consider the following code:
struct Foo {
alias Bar = Object;
}
void main() {
with (Foo()) {
static void baz() {
// this works
auto a = new Bar;
// this doesn't?
auto b = Bar.classinfo;
}
}
}
DMD claims:
onlineapp.d(11): Error: `static` function `onlineapp.main.baz` cannot access variable `__withSym` in frame of function `D main`
But it doesn't need the frame, because it's accessing a type alias, and it knows this when doing `new Bar`, but somehow not when doing `Bar.classinfo`?
Comment #1 by robert.schadek — 2024-12-13T19:25:23Z