www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10028] New: UFCS requires explicit "this"

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10028

           Summary: UFCS requires explicit "this"
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: puneet coverify.org



---
Consider the following code ...

class Foo {            // 1
  void foo() {            // 2
    bar();            // 3
    this.bar();            // 4
  }                // 5
}                // 6
void bar(Foo f) {        // 7
  import std.stdio;        // 8
  writeln("This bar");        // 9
}                // 10
void main() {            // 11
  Foo test = new Foo;        // 12
  test.foo();            // 13
}                // 14

DMD is fine with line 4 because of UFCS. But it gives an error for line 3
because it does not get this pointer to bind as argument.

I would expect even line 3 to compile.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 04 2013
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10028


Maxim Fomin <maxim maxim-fomin.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |maxim maxim-fomin.ru
         Resolution|                            |INVALID



---
Closed, see
http://forum.dlang.org/thread/mailman.1027.1367665889.4724.digitalmars-d puremagic.com

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 04 2013