[Issue 9124] Object variable of variadic template struct needs explicit "this" in certain situations

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Dec 12 09:35:20 PST 2012


http://d.puremagic.com/issues/show_bug.cgi?id=9124


Puneet Goel <puneet at coverify.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |


--- Comment #3 from Puneet Goel <puneet at coverify.org> 2012-12-12 09:35:19 PST ---
I am reopening the bug with a different testcase that is still failing with the
same error. Please see the comments below in the code to locate the offending
line.

template Foo (T, U, string OP) {
  enum N = T.SIZE;
  alias Foo!(false, true, N) Foo;
}

struct Foo (bool S, bool L, N...) {
  enum SIZE = 5;
  long[1] _a = 0;
  void someFunction() const {
    auto data = _a;        // Does not compile
    // auto data = this._a; // <--- Compiles
  }
  auto opBinary (string op, T) (T ) {
    Foo!(typeof(this), T, op) test;
  }
}

void main() {
  auto p = Foo!(false, false, 5)();
  auto q = Foo!(false, false, 5)();
  p|q;
  p&q;
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list