That's because you're creating a new type with typedef, and writeln() doesn't know how to work with a "number" type. Use an alias:
void main() { alias int number; number x; x = 314; writeln(x); } AFAIK typedef is scheduled for deprecation in D2 (if that's what you're using). On 12/27/10, Hamad Mohammad <h.bat...@hotmail.com> wrote: > I can't compile this code > > void main() > { > typedef int number; > number x; > x = 314; > writeln(x); > } > >