[Issue 17123] New: [REG 2.073] Issues with return @safe inference

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Jan 26 05:41:22 PST 2017


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

          Issue ID: 17123
           Summary: [REG 2.073] Issues with return @safe inference
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: public at dicebot.lv

Several compilation issues in https://github.com/jacob-carlborg/dstep because
of attribute inference + return

Most simple example:

---
void main ()
{
    import std.socket;
    auto f = new TcpSocket;

    char[256] buffer;

    char[] delegate() read = () {
        size_t num = f.receive(buffer);
        return buffer[0 .. num];
    };
}
---

sample.d(8): Error: cannot implicitly convert expression (__lambda1) of type
char[] delegate() return @safe to char[] delegate()
sample.d(8): Error: cannot implicitly convert expression (__lambda1) of type
char[] delegate() return @safe to char[] delegate()

--


More information about the Digitalmars-d-bugs mailing list