www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - Code with no effect compiles okay

reply Derek Parnell <derek psych.ward> writes:
[file: test.d]
class Foo {}
void main() { new Foo; }


[CMD: dmd -w test.d ]

-- 
Derek Parnell
Melbourne, Australia
http://www.dsource.org/projects/build/ v1.19 released 04/Apr/2005
http://www.prowiki.org/wiki4d/wiki.cgi?FrontPage
6/04/2005 2:41:24 PM
Apr 05 2005
parent reply zwang <nehzgnaw gmail.com> writes:
Derek Parnell wrote:
 [file: test.d]
 class Foo {}
 void main() { new Foo; }
 
 
 [CMD: dmd -w test.d ]
 
There's nothing wrong with the code. I would be surprised if it didn't compile.
Apr 06 2005
parent "Regan Heath" <regan netwin.co.nz> writes:
On Thu, 07 Apr 2005 00:46:05 +0800, zwang <nehzgnaw gmail.com> wrote:
 Derek Parnell wrote:
 [file: test.d]
 class Foo {}
 void main() { new Foo; }
   [CMD: dmd -w test.d ]
There's nothing wrong with the code. I would be surprised if it didn't compile.
True. IIRC one of the goals of D was to make meaningless code illegal. Maybe that is limited to where it commonly causes a bug eg. a == b; //programmer meant a = b; Regan
Apr 06 2005