Bug 10028 – UFCS requires explicit "this"

Status
RESOLVED
Resolution
INVALID
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-05-04T05:20:00Z
Last change time
2013-05-04T09:13:06Z
Assigned to
nobody
Creator
puneet

Comments

Comment #0 by puneet — 2013-05-04T05:20:03Z
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.
Comment #1 by maxim — 2013-05-04T09:13:06Z