[Issue 19060] New: [REG2.081] Incorrect "Using this as a type is deprecated" error

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jul 4 22:14:00 UTC 2018


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 at puremagic.com
          Reporter: johanengelen at 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

--


More information about the Digitalmars-d-bugs mailing list