www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 14249] New: Loose error check for incorrect template mixin

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

          Issue ID: 14249
           Summary: Loose error check for incorrect template mixin
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: accepts-invalid
          Severity: normal
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: k.hara.pg gmail.com

Following code should fail to compile, but doesn't.

mixin template Mix()
{
//  shared static this() {}
    shared static ~this() {}
//  static this() {}'func.c'
    static ~this() {}
    unittest {}
//  invariant {}
//  alias a this;
//  new(size_t sz) { return null; }
//  delete(void* p) { }
//  this(int) {}
//  this(this) {}
//  ~this() {}
//  union { int x; double y; }
}
void main()
{
    mixin Mix!();
}

--
Mar 05 2015