Smoking gun:
struct A(T)
{
struct B
{
this(size_t);
this(size_t) immutable
{
}
this(string s)
{
this(s.length);
}
}
}
void main()
{
A!int s1;
}
This fails with:
test.d(15): Error: test.A!int.A.B.__ctor called with argument types (ulong) matches both:
test.d(7): test.A!int.A.B.this(ulong)
and:
test.d(9): test.A!int.A.B.this(ulong _param_0)
test.d(22): Error: template instance test.A!int error instantiating
Deleting the body of the immutable constructor oddly makes the error go away (becomes a link-time error; adding a body for the first constructor makes the program compile and link).
Comment #1 by robert.schadek — 2024-12-13T18:26:41Z