March 06, 2023
https://issues.dlang.org/show_bug.cgi?id=23760

          Issue ID: 23760
           Summary: Error: unknown
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody@puremagic.com
          Reporter: john.loughran.colvin@gmail.com

The code below produces the following error when compiled, so I am obeying its command:

Error: unknown, please file report on issues.dlang.org
app.d(19): Error: `(A).state` cannot be resolved
app.d(7): Error: template instance `arsd.jni.JavaBridge!(A)` error
instantiating
app.d(29):        instantiated from here: `JavaClass!("fin", A)`
app.d(26): Error: mixin `arsd.jni.JavaClass!("fin",
A).JavaClass.ImportExportImpl!(A)` error instantiating




module arsd.jni;

static T (){
}

template ImportExportImpl(Class) {
arsd.jni.JavaBridge!(Class) _javaDBridge;
}

template ImportExportImpl() {
}

class JavaBridge(Class) {
        static foreach(memberName; __traits(derivedMembers, Class)) {
                // validations
                static if(is(typeof(__traits(getMember, Class, memberName))))
                        static assert(1); // FIXME
                // implementations
                static foreach(oi; __traits(getOverloads, Class, memberName))
                                mixin JavaImportImpl;
        }
}


class JavaClass(string javaPackage, CRTP) {
        mixin ImportExportImpl!CRTP;
}

class A : JavaClass!("fin", A) {
        State* state;
}

--