[Issue 20674] [DIP1000] inference of `scope` is easily confused

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Aug 10 10:36:57 UTC 2021


https://issues.dlang.org/show_bug.cgi?id=20674

Dennis <dkorpel at live.nl> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dkorpel at live.nl

--- Comment #3 from Dennis <dkorpel at live.nl> ---
(In reply to Walter Bright from comment #1)
> To do what this example asks for, data flow analysis would be required. This
> can be done, but is a large increase in implementation complexity and time
> to compile.

This puzzles me. The examples don't contain a single branch or loop. Surely you
can infer scope here without creating a control-flow graph, right? Also, while
I don't know exactly how the current inference works (it's not documented
anywhere), it looks like it has a pretty complex loop already:

https://github.com/dlang/dmd/blob/8884ad0d232d300b424c025cf65ecd2623ec8df5/src/dmd/escape.d#L2176

--


More information about the Digitalmars-d-bugs mailing list