On Fri, 15 Jul 2011 12:32:05 +0200, BizarreCake <bizarrec...@gmail.com> wrote:

While coding, I've stumbled upon this weird bug.
Apparently, this code snippet right here:

        module program;

        import std.stdio;

        class Foo {
                void bar() {
                        writeln( "Foo Bar!" );
                }
        }

        void main() {
                new Foo().bar();
        }

Doesn't work.
It outputs the following error:
    program.d(12): found '.' when expecting ';' following statement

Line 12 is: new Foo().bar();

This newsfroup is for automated posts by the BugZilla issue-tracker
system. If you want to file a bug, please visit
http://d.puremagic.com/issues/
or discuss your find in digitalmars.D.learn.

As for your actual problem, thinks are working as intended. The
compiler believes you wanted to write
  new (Foo().bar());
whereas you more likely meant
  (new Foo()).bar();

--
  Simen

Reply via email to