www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 17953] New: inout-like mechanism to infer function attributes


          Issue ID: 17953
           Summary: inout-like mechanism to infer function attributes from
                    callback attributes
           Product: D
           Version: D2
          Hardware: Other
                OS: Other
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: code dawg.eu

Not being able to correctly attribute methods is a common issue when designing
interfaces and classes. While it's often still possible to restrict all derived
classes to certain attributes, it's a lot harder to restrict all possible

  void toString(scope void delegate(in char[])  wildcard)  (wildcard nogc

It would be a great help if such a method could be defined, to that  nogc,
 safe, pure, and nothrow can be made dependent on the passed in callback,
making it possible to call the method in  nogc code, while also passing in a GC
using callback.

Oct 30 2017