[Issue 15027] cannot pass arguments of type DirEntry to std.file functions

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue Oct 6 21:14:31 PDT 2015


https://issues.dlang.org/show_bug.cgi?id=15027

--- Comment #13 from Walter Bright <bugzilla at digitalmars.com> ---
(In reply to Rainer Schuetze from comment #8)
> It still fails, so instead of emitting an error message the compiler could
> change the type of the function arguments to the aliased type and retry
> deduction and constraint check. For multiple arguments with alias this, this
> could lead to a large number of possible combinations to try, though.

Given how overloading even now can lead to inexplicable seeming results, I view
such an additional layer of complexity as a looming disaster, especially with
the combinatorial aspect of it.

I have thought about something like:

    struct foo(T : isInputRange) { ... }

where the constraint would become part of the type deduction logic, but that's
a major addition to the language, not something we can just throw in.

--


More information about the Digitalmars-d-bugs mailing list