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?
Comment #2 by k.hara.pg — 2013-11-17T05:36:08Z
Comment #3 by k.hara.pg — 2013-11-17T05:38:04Z
(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
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/57d52dd4ab946b7b9813df1f57021880861fabcd fix Issue 9690 - cannot access to @disable'd symbol from inner function of another @disable'd https://github.com/D-Programming-Language/dmd/commit/20c23427355bb9d91ab995c4c3cb153a17d29985 Merge pull request #2799 from 9rnsr/fix9690 Issue 9690 - cannot access to @disable'd symbol from inner function of another @disable'd