www.digitalmars.com         C & C++   DMDScript  

D - [recursive typedef] why allow them, but forbid recursive aliases?

why are recursive typdefs allowed, but recursive aliases forbidden?

Replacing the alias that crahsed dmd by a typedef works fine:


typedef myfunc delegate(uint) myfunc;
void main(){
  myfunc fr;

  myfunc f(uint num){
    printf("hello world\n");
    return fr;
  }
  
  fr= &f;

  fr= fr(1);
  
  fr(2);
}


So long!
Mar 30 2004