www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 14283] New: [2.067-b4]: Spurious "this is not an lvalue"

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

          Issue ID: 14283
           Summary: [2.067-b4]: Spurious "this is not an lvalue"
                    deprecation message for "auto ref" arguments
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: sludwig outerproduct.org

"auto ref" should deduce "this" argument to non-ref to avoid a deprecation
message showing up for valid code. The original place where this was triggered
was for std.typecons.scoped, where all arguments are declared as "auto ref".

---
class C {
    void foo() {
        bar(this);
    }
}

void bar()(auto ref C) {}
---

(3): Deprecation: this is not an lvalue

--
Mar 14 2015