www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 16215] New: Nested class unable to resolve outer class

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

          Issue ID: 16215
           Summary: Nested class unable to resolve outer class variables
                    in certain scenarios
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: puneet coverify.org

This is one of the corner cases that I could reduce.

bool frop(int f) {return true;}
class Bar {
  int zoo;
  class Foo {
    bool foo() {
      return (zoo).frop();
    }
  }
}

$  dmd -c test.d
test.d(6): Error: need 'this' for 'zoo' of type 'int'

--
Jun 27 2016