[Issue 19529] New: An example from Wikipedia does not compile

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Dec 31 04:18:15 UTC 2018


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

          Issue ID: 19529
           Summary: An example from Wikipedia does not compile
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: major
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: porton at narod.ru

---
template t(T){
  T get(){
    return mValue;
  }
}

class C{
  private int mValue;
  mixin t(int);
}
---

$ dmd test.d
test.d(9): Error: ; expected after mixin
test.d(9): Error: no identifier for declarator int
test.d(9): Error: declaration expected, not )

The code above is from https://en.wikibooks.org/wiki/D_Programming/Mixins

--


More information about the Digitalmars-d-bugs mailing list