D - Strange behavior of typedef
- Matthias Becker <Matthias_member pathlink.com> Jan 27 2004
- "Walter" <walter digitalmars.com> Jan 28 2004
- Matthias Becker <Matthias_member pathlink.com> Jan 29 2004
class MyClass {}
typdef MyTypedef {}
class MyDerived : MyClass {}
class MyTypedefDerived : MyTypedef {}
int main ()
{
MyClass foo = new MyDerived(); // works fine
MyTypedef bar = new MyTypedefDerived(); // doesn't work :(
return 0;
}
Jan 27 2004
"Matthias Becker" <Matthias_member pathlink.com> wrote in message news:bv5i4g$1g73$1 digitaldaemon.com...class MyClass {} typdef MyTypedef {}
I don't know what you meant to happen here, but "typdef" should be "typedef", and the syntax is for a class declaration, not a typedef.class MyDerived : MyClass {} class MyTypedefDerived : MyTypedef {} int main () { MyClass foo = new MyDerived(); // works fine MyTypedef bar = new MyTypedefDerived(); // doesn't work :( return 0; }
Jan 28 2004
"Matthias Becker" <Matthias_member pathlink.com> wrote in message news:bv5i4g$1g73$1 digitaldaemon.com...class MyClass {} typdef MyTypedef {}
I don't know what you meant to happen here, but "typdef" should be "typedef", and the syntax is for a class declaration, not a typedef.
Sorry, I ment. class MyClass {} typdef MyClass MyTypedef; Damn. I had this at home, but hadn't have the time to report it. So I did it the next day at work (so I caouldn't use copy&paste).class MyDerived : MyClass {} class MyTypedefDerived : MyTypedef {} int main () { MyClass foo = new MyDerived(); // works fine MyTypedef bar = new MyTypedefDerived(); // doesn't work :( return 0; }
Jan 29 2004








Matthias Becker <Matthias_member pathlink.com>