digitalmars.D - UFCS requires explicit this
- d coder (22/22) May 04 2013 Greetings
- Timon Gehr (1/1) May 04 2013 This is to be expected.
- d coder (5/6) May 04 2013 Timon, you mean such support is planned, or is the current behavior the
- Timon Gehr (3/6) May 04 2013 The current behaviour is expected.
Greetings
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 UCFS. But it gives an error for line 3
because it does not get this pointer to bind as argument.
I want to know if it is a DMD bug or whether line 3 would be compilable at
some point in future.
Regards
- Puneet
May 04 2013
Timon, you mean such support is planned, or is the current behavior the expected behavior. Regards - Puneet On Sat, May 4, 2013 at 4:57 PM, Timon Gehr <timon.gehr gmx.ch> wrote:This is to be expected.
May 04 2013
On 05/04/2013 01:57 PM, d coder wrote:Timon, you mean such support is planned, or is the current behavior the expected behavior. ...The current behaviour is expected. UFCS is a rewrite rule from a.b(args...) to b(a,args...).
May 04 2013








Timon Gehr <timon.gehr gmx.ch>