www.digitalmars.com         C & C++   DMDScript  

D - template instatiation inside another template

reply "Daniel Yokomiso" <daniel_yokomiso yahoo.com.br> writes:
Hi,

    The following code doesn't compile with dmd 0.49 (didn't compile with
0.48 either):

module bug;
template A(T) {
    T id(T t) {
        return t;
    }
}

module bug2;
import bug;
template B(T) {
    private instance A(T) a;
    T same(T t) {
        return a.id(t);
    }
}
int main() {
    instance B(int) b;
    printf("%d\r\n", b.same(10));
    return 0;
}

    It gives the message "symbol __anonymous '__anonymous' has no semantic
routine" after semantic3 in bug2 module.


    Best regards,
    Daniel Yokomiso.
"I'm less of a neurotic perfectionist than I was. But I don't think that
anyone who has done good work in their life isn't a perfectionist. You have
to be."

- John Cleese
Nov 19 2002
parent "Walter" <walter digitalmars.com> writes:
I'll have a look. -Walter
Nov 19 2002