Bug 5095 – Error for typesafe variadic functions for structs

Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2010-10-21T14:07:55Z
Last change time
2021-03-19T19:22:10Z
Keywords
diagnostic
Assigned to
No Owner
Creator
bearophile_hugs
See also
https://issues.dlang.org/show_bug.cgi?id=21736

Comments

Comment #0 by bearophile_hugs — 2010-10-21T14:07:55Z
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.
Comment #1 by lt.infiltrator — 2014-03-19T03:52:26Z
In v2.065, this produces: Error: function f14.test (Foo f...) is not callable using argument types (int) Is that acceptable; or do you still want the second part which you suggested?
Comment #2 by bearophile_hugs — 2014-03-19T04:23:26Z
(In reply to comment #1) > In v2.065, this produces: > > Error: function f14.test (Foo f...) is not callable using argument types (int) > > Is that acceptable; or do you still want the second part which you suggested? The error message is acceptable. Closed issue.