www.digitalmars.com         C & C++   DMDScript  

D - minor bugs - 1 attachment

reply Farmer <itsFarmer. freenet.de> writes:
Walter,

the attachment shows some bugs, that I found in DMD 0.67 (Win).


Farmer. 

begin 644 crash.d
M<W1R=6-T($%R<F%Y#0I[#0H):6YT(&QE;CL-" EV;VED*B!P.PT*?0T*07)R
M87D 9B I#0I[#0H)8VAA<EM=(&$[#0HO+R!R971U<FX *F-A<W0H07)R87DJ
M*2`F85LP+BXR,UT[("\O26YT97)N86P 97)R;W(Z("XN7'IT8UQC9V-S+F, 
M,S4P#0H)<F5T=7)N("IC87-T*$%R<F%Y*BD )F$[("\O=V]R:W,-"GT-" T*
M#0HO+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O
M+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+PT*
M#0HO+R!C;VYS="!U:6YT($U!6%]325I%.R`-"F-O;G-T('5I;G0 34%87U-)
M6D4]-#<[#0IV;VED(&8R*"D-"GL-" EC:&%R6UT 83UN97< 8VAA<EM-05A?
M4TE:15T[("\O1$U$(&-R87-H97, =VAE;B!-05A?4TE:12!I<R!N;W0 :6YI
M=&EA;&EZ960-"GT-" T*#0HO+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O
M+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O
M+R\O+R\O+R\O+R\O+PT*#0IV;VED(&8S*"D-"GL-" EV;VED*B!P,3UN97< 
M8VAA<ELT-UT[#0H)=F]I9"H <#(];F5W(&-H87);-#==.PT*#0H)*&-A<W0 
M*&-H87(J*7`Q*5LP+BXT-UT]/2AC87-T("AC:&%R*BEP,BE;,"XN-#==.R`O
M+W=O<FMS#0HO+R`H8V%S="`H=F]I9"HI<#$I6S`N+C0W73T]*&-A<W0 *'9O
M:60J*7`R*5LP+BXT-UT[("\O17)R;W(Z(%-Y;6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O('=O<FMS#0I]#0H-" T*#0HO+R\O+R\O+R\O
M+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O
M+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O#0H-" T*<W1A=&EC(&EN
M="!S;VUE1VQO8F%L5F%R.R` ("\O(&YO(&5R<F]R<R!R97!O<G1E9"`M(&)U
M="!T:&5N('=H870G<R!T:&4 ;65A;FEN9R!O9B`G<W1A=&EC)R!H97)E/PT*
M#0H-"B\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O
M+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\-
M" T*#0IC;&%S<R!!0VQA<W,-"GL-" ES=&%T:6, =F]I9"!S:&PH8VAA<BH 
M=BD-" E[#0H)?0T*#0H)<W1A=&EC('9O:60 <VAL*&-H87);72!V*0T*"7L-
M" E]#0H-"GT-"G9O:60 9C4H*0T*>PT*+R\)04-L87-S(#P\(&-A<W0H8VAA
M<EM=*2(B.PDO+R!%<G)O<CH 9G5N8W1I;VX <VAL(&]V97)L;V%D<R!V;VED
M*&-H87(J=BD 86YD('9O:60H8VAA<EM==BD 8F]T:"!M871C:"!A<F=U;65N
M="!L:7-T(&9O<B!S:&P-" E!0VQA<W,N<VAL*&-A<W0H8VAA<EM=*2(B*3LO
*+R!W;W)K<PT*?0``
`
end
Jun 23 2003
parent reply Farmer <itsFarmer. freenet.de> writes:
I slowly start to realize that "this" is a pointer for structs, so 

struct SomeStruct
{
   SomeStruct f(int n4)
   {
	return *this;      	
    	// return this; // Error: cannot implicitly convert SomeStruct * to 
   }
}

isn't a bug at all. 

Now I discovered that I can refer via the structname to (non-static) member 
variables. This seems odd. 
Is this a bug or is it sugar to avoid the rather painful use of "(*this)."

struct SomeStruct
{
   void toString()
   {
   }
   void memberFunction()
   {
      toString();            // correct, but sometimes hard to understand
      (*this).toString();    // correct, but clumsy to write
      SomeClass.toString();  // access member variable via static reference
   }
};




Farmer <itsFarmer. freenet.de> wrote in 
news:Xns93A3CC1351191itsFarmer 63.105.9.61:

 
 Walter,
 
 the attachment shows some bugs, that I found in DMD 0.67 (Win).
 
 
 Farmer. 
 
 begin 644 crash.d
 Attachment decoded: crash.d
 `
 end
 
Jun 26 2003
parent "Walter" <walter digitalmars.com> writes:
"Farmer" <itsFarmer. freenet.de> wrote in message
news:Xns93A6D6CEE6038itsFarmer 63.105.9.61...
       SomeClass.toString();  // access member variable via static
reference That shouldn't work.
Jun 27 2003