Bug 9690 – cannot access to @disable'd symbol from inner function of another @disable'd
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-03-11T07:49:00Z
Last change time
2013-11-21T22:03:33Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
kekeniro2
Comments
Comment #0 by kekeniro2 — 2013-03-11T07:49:08Z
This code does not work.
@disable {
void dep() { }
void main() {
dep(); // OK
void inner() {
dep(); // cannot call dep
}
}
}
When you replace '@disable' with 'deprecated', it works. ( even with -de )
I believe that both '@disable' and 'deprecated' should work in the same way.
Comment #1 by andrej.mitrovich — 2013-03-11T17:06:35Z
The problem is that @disable does not work recursively, 'inner' is not actually disabled. You can verify this by marking 'inner' with @disable.
I'm not sure if it's supposed to be this way. Kenji?
(In reply to comment #0)
> This code does not work.
>
> @disable {
> void dep() { }
> void main() {
> dep(); // OK
> void inner() {
> dep(); // cannot call dep
> }
> }
> }
>
> When you replace '@disable' with 'deprecated', it works. ( even with -de )
> I believe that both '@disable' and 'deprecated' should work in the same way.
In this case, @disable attribute should work like deprecated attribute.
Comment #4 by github-bugzilla — 2013-11-21T22:03:20Z