www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Should the compiler be able to do a double look up?

reply 12345swordy <alexanderheistermann gmail.com> writes:
Context: https://github.com/dlang/dmd/pull/9702

Would a double look up be able to fix this bug properly?

-Alex
Dec 31 2020
parent Paul Backus <snarwin gmail.com> writes:
On Thursday, 31 December 2020 at 18:52:18 UTC, 12345swordy wrote:
 Context: https://github.com/dlang/dmd/pull/9702

 Would a double look up be able to fix this bug properly?

 -Alex
Lots of things would be able to fix it. The most obvious way would be to have each template alias parameter carry its own (optional) context pointer with it--then there'd be no need for different contexts to fight over who owns the "this" pointer. Unfortunately the implementation of closures and context pointers in DMD is not very high-quality to begin with (see the many, many delegate-related issues in bugzilla), so any actual attempt to solve issue 5710 has to either address or work around the existing technical debt in that part of the frontend.
Dec 31