[Issue 5095] New: Error for typesafe variadic functions for structs

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Oct 21 14:08:36 PDT 2010


http://d.puremagic.com/issues/show_bug.cgi?id=5095

           Summary: Error for typesafe variadic functions for structs
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: diagnostic
          Severity: minor
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: bearophile_hugs at eml.cc


--- Comment #0 from bearophile_hugs at eml.cc 2010-10-21 14:07:55 PDT ---
This is a wrong D2 progra:

struct Foo {
    int x;
    this(int x_) {
        this.x = x_;
    }
}
void test(Foo f ...) {}
void main() {
    test(1);
}



DMD 2.049 shows at compile-time:

test.d(9): Error: function test2.test (Foo f...) is not callable using argument
types (int)
test.d(9): Error: cannot implicitly convert expression (1) of type int to Foo



But I'd like a better single error message, like for example:

test.d(9): Error: function test2.test (Foo f...) is not callable using argument
types (int), typesafe variadic functions for structs are not supported.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list