Summary: Built struct is callable without opCall
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: accepts-invalid
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from 2010-08-19 06:19:14 PDT ---
This D1 program compiles and runs with DMD 2.048:

import std.c.stdio: puts;
struct Foo {
    this(int) { puts("THIS"); }
void main() {
    auto bar = Foo(10);

The output:

So the Foo constructor is run two times. I think this is not correct.

Foo lacks an opCall, so what I expect is a compile-time error that says that
'bar' is not callable.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to