[Issue 7943] New: UFCS does not work with alias this
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Apr 19 04:46:09 PDT 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7943
Summary: UFCS does not work with alias this
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: jens.k.mueller at gmx.de
--- Comment #0 from jens.k.mueller at gmx.de 2012-04-19 04:47:04 PDT ---
The following code does not compile but it should.
ufcs.d:
struct Foo
{
int _member;
alias _member this;
}
int foo(Foo f) { return f._member; }
unittest
{
Foo f;
f.foo(); // fails to compile
}
Using dmd2.059 you get:
Error: function ufcs.foo (Foo f) is not callable using argument types (int)
Error: cannot implicitly convert expression (f._member) of type int to Foo
Note, that this bugs prevents using UFCS with std.typecons.Tuple.
http://forum.dlang.org/thread/mailman.1925.1334827762.4860.digitalmars-d@puremagic.com
--
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