www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 19091] New: __traits(compiles) and error in templated structs


          Issue ID: 19091
           Summary: __traits(compiles) and error in templated structs
                    leads to missing symbol
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: default_357-line yahoo.de

Minimized repro: 

enum compiles = __traits(compiles, Outer!());

struct Inner()
    // Note syntax error: missing return statement. This is important?
    int foo() { }

    void bar() { }

struct Outer()
    Inner!() field;

void main()


  Compiler error: missing return statement in foo


  Linker error: undefined reference to test.Inner.bar()

Jul 17 2018