www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 24109] New: [REG2.103] 'need this' when invoking outer method

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

          Issue ID: 24109
           Summary: [REG2.103] 'need this' when invoking outer method from
                    inner method
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: kinke gmx.net

This doesn't compile anymore since D v2.103 (and still doesn't with v2.105.0):
```
struct Outer {
    void method1() {}

    void method2() {
        class Inner {
            void innerMethod() {
                method1();
            }
        }
    }
}
```

```
Error: need `this` for `method1` of type `void()`
```

--
Aug 25 2023