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. 
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

That shouldn't work.
Jun 27 2003