www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 19060] New: [REG2.081] Incorrect "Using this as a type is

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

          Issue ID: 19060
           Summary: [REG2.081] Incorrect "Using this as a type is
                    deprecated" error
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: johanengelen weka.io

Testcase:
```
struct S {
    bool x;

    public template yoyo() {
        alias yoyo = this.x; // line 5
    }

     public ref foo() {
        return yoyo!();
    }
}
```

Works correctly with dmd < 2.081, fails (incorrect deprecation) with 2.081:

❯ dmd testcase.d -de
testcase.d(5): Deprecation: Using this as a type is deprecated. Use
typeof(this) instead

--
Jul 04 2018