digitalmars.D.bugs - DMD 0.126, wow!
- Andrew Fedoniouk (24/24) Jun 08 2005 import std.stdio;
- John Reimer (6/35) Jun 08 2005 LOL!
- Andrew Fedoniouk (8/40) Jun 09 2005 :) I did small compiler for subset of Java once.
- Unknown W. Brackets (2/31) Jun 09 2005
- Stewart Gordon (8/35) Jun 09 2005 Yes, since B is both a member of A and a subclass of A, it inherits itse...
- =?UTF-8?B?VGhvbWFzIEvDvGhuZQ==?= (4/28) Jun 11 2005 Added to DStress as
import std.stdio; class A { class B:A { const int C = 5; } } int main() { writef ("1 %d\n", A.B.C); writef ("2 %d\n", A.B.B.C); writef ("3 %d\n", A.B.B.B.C); writef ("4 %d\n", A.B.B.B.B.C); writef ("5 %d\n", A.B.B.B.B.B.C); writef ("6 %d\n", A.B.B.B.B.B.B.C); writef ("7 %d\n", A.B.B.B.B.B.B.B.C); writef ("8 %d\n", A.B.B.B.B.B.B.B.B.C); //..... writef ("X %d\n", A.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.C); return 0; } Compiles and works just fine :)
Jun 08 2005
Andrew Fedoniouk wrote:import std.stdio; class A { class B:A { const int C = 5; } } int main() { writef ("1 %d\n", A.B.C); writef ("2 %d\n", A.B.B.C); writef ("3 %d\n", A.B.B.B.C); writef ("4 %d\n", A.B.B.B.B.C); writef ("5 %d\n", A.B.B.B.B.B.C); writef ("6 %d\n", A.B.B.B.B.B.B.C); writef ("7 %d\n", A.B.B.B.B.B.B.B.C); writef ("8 %d\n", A.B.B.B.B.B.B.B.B.C); //..... writef ("X %d\n", A.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.C); return 0; } Compiles and works just fine :)LOL! You just had to try that, didn't you? Good ammo for obfuscated D. Nice to know inner classes have more than one use. ;) -JJR
Jun 08 2005
"John Reimer" <brk_6502 yahoo.com> wrote in message news:d88m0j$ii0$1 digitaldaemon.com...Andrew Fedoniouk wrote::) I did small compiler for subset of Java once. So I can predict typical problems more or less reliably. That was just first what came up in my mind.import std.stdio; class A { class B:A { const int C = 5; } } int main() { writef ("1 %d\n", A.B.C); writef ("2 %d\n", A.B.B.C); writef ("3 %d\n", A.B.B.B.C); writef ("4 %d\n", A.B.B.B.B.C); writef ("5 %d\n", A.B.B.B.B.B.C); writef ("6 %d\n", A.B.B.B.B.B.B.C); writef ("7 %d\n", A.B.B.B.B.B.B.B.C); writef ("8 %d\n", A.B.B.B.B.B.B.B.B.C); //..... writef ("X %d\n", A.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.C); return 0; } Compiles and works just fine :)LOL! You just had to try that, didn't you?Good ammo for obfuscated D. Nice to know inner classes have more than one use. ;)That inners... "Stay tuned" as they say and keep around your favorite helmet. Andrew.
Jun 09 2005
I can imagine there are some practical uses for this behavior... -[Unknown]import std.stdio; class A { class B:A { const int C = 5; } } int main() { writef ("1 %d\n", A.B.C); writef ("2 %d\n", A.B.B.C); writef ("3 %d\n", A.B.B.B.C); writef ("4 %d\n", A.B.B.B.B.C); writef ("5 %d\n", A.B.B.B.B.B.C); writef ("6 %d\n", A.B.B.B.B.B.B.C); writef ("7 %d\n", A.B.B.B.B.B.B.B.C); writef ("8 %d\n", A.B.B.B.B.B.B.B.B.C); //..... writef ("X %d\n", A.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.C); return 0; } Compiles and works just fine :)
Jun 09 2005
Andrew Fedoniouk wrote:import std.stdio; class A { class B:A { const int C = 5; } } int main() { writef ("1 %d\n", A.B.C); writef ("2 %d\n", A.B.B.C); writef ("3 %d\n", A.B.B.B.C); writef ("4 %d\n", A.B.B.B.B.C); writef ("5 %d\n", A.B.B.B.B.B.C); writef ("6 %d\n", A.B.B.B.B.B.B.C); writef ("7 %d\n", A.B.B.B.B.B.B.B.C); writef ("8 %d\n", A.B.B.B.B.B.B.B.B.C); //..... writef ("X %d\n", A.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.C); return 0; } Compiles and works just fine :)Yes, since B is both a member of A and a subclass of A, it inherits itself. A.B.B is the same thing as A.B, and so the compiler would reduce each long expression to the previous and so on. Stewart. -- My e-mail is valid but not my primary mailbox. Please keep replies on the 'group where everyone may benefit.
Jun 09 2005
Andrew Fedoniouk wrote:import std.stdio; class A { class B:A { const int C = 5; } } int main() { writef ("1 %d\n", A.B.C); writef ("2 %d\n", A.B.B.C); writef ("3 %d\n", A.B.B.B.C); writef ("4 %d\n", A.B.B.B.B.C); writef ("5 %d\n", A.B.B.B.B.B.C); writef ("6 %d\n", A.B.B.B.B.B.B.C); writef ("7 %d\n", A.B.B.B.B.B.B.B.C); writef ("8 %d\n", A.B.B.B.B.B.B.B.B.C); //..... writef ("X %d\n", A.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.C); return 0; } Compiles and works just fine :)Added to DStress as http://dstress.kuehne.cn/run/c/class_16.d Thomas
Jun 11 2005