This is invalid code in D 2.0, as templates cannot be used to add fields to a class.
Comment #3 by 2korden — 2008-06-30T05:39:00Z
Updated test case for D2:
class Test {
template test(){
enum int test = 1; // replace with const for D1
}
}
void main(){
printf("%d", (new Test()).test!());
}