www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 7943] New: UFCS does not work with alias this

reply d-bugmail puremagic.com writes:
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 puremagic.com
        ReportedBy: jens.k.mueller gmx.de



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: -------
Apr 19 2012
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7943


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull, rejects-valid



https://github.com/D-Programming-Language/dmd/pull/890

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 19 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7943




Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/4540f0b9e1bbd1b251d5e49428a6a5c0cd1f9c65
fix Issue 7943 - UFCS does not work with alias this

https://github.com/D-Programming-Language/dmd/commit/11f70c7b5cea33e9a93601b2a2fdabb260d47276


Issue 7943 - UFCS does not work with alias this

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 19 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7943


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla digitalmars.com
         Resolution|                            |FIXED


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 19 2012