[Issue 10526] New: opDispatch with IFTI should not disable UFCS
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Jul 2 19:27:22 PDT 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10526
Summary: opDispatch with IFTI should not disable UFCS
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Keywords: rejects-valid
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: k.hara.pg at gmail.com
--- Comment #0 from Kenji Hara <k.hara.pg at gmail.com> 2013-07-02 19:27:17 PDT ---
From: http://forum.dlang.org/post/cxgefmgjnzgoizrdtcbb@forum.dlang.org
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
}
--
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