Bug 10526 – opDispatch with IFTI should not disable UFCS
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-07-02T19:27:00Z
Last change time
2013-07-05T11:20:44Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
k.hara.pg
Comments
Comment #0 by k.hara.pg — 2013-07-02T19:27:17Z
From: http://forum.dlang.org/post/[email protected]
In following code, opDispatch call requires IFTI due to TemplateTupleParameter T deduction. However it unexpectedly disables UFCS.
import std.conv, std.stdio, std.algorithm;
struct S
{
void opDispatch(string s, T...)(T t)
if (s.startsWith("foo"))
{
writeln(s);
}
}
void main()
{
S s;
s.foo();
// --> OK
auto p = s.to!string();
// --> Error: s.opDispatch!("to") isn't a template
}