Bug 12018 – More descriptive message for frame access error
Status
RESOLVED
Resolution
WORKSFORME
Severity
enhancement
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-01-28T08:14:58Z
Last change time
2022-12-02T15:57:47Z
Keywords
diagnostic
Assigned to
No Owner
Creator
bearophile_hugs
Comments
Comment #0 by bearophile_hugs — 2014-01-28T08:14:58Z
This is wrong code:
void main() {
int x;
static void bar() {
x++;
}
}
dmd 2.065beta correctly gives an error message:
test.d(4): Error: static function test.main.bar cannot access frame of function D main
But I'd like the name 'x' to be present in the error message. Because in a complex line of code it's not easy to see what variable comes from the outer scope.
Comment #1 by razvan.nitu1305 — 2022-12-02T15:57:47Z