Two questions

IM 3di at gm.com
Wed Jan 2 23:24:11 UTC 2019


On Wednesday, 2 January 2019 at 21:56:03 UTC, Steven 
Schveighoffer wrote:
> On 1/2/19 12:38 PM, IM wrote:
>
>> [...]
>
> With those ... I have to guess.
>
> There are 2 possibilities.
>
> Possibility 1: there is a method named 'doSomeWork' which takes 
> at least one parameter. This overrides the UFCS function 
> (member functions always win over UFCS).
>
> Possibility 2: All this is actually inside a function or 
> unittest. Nested functions cannot participate in UFCS.
>

Perfect, this was it. Thank you so much. doSomeWork() was nested 
inside a unittest{} block. I didn't know UFCS won't work in this 
case.

> Of course, these are guesses. But given the very scant code 
> above, I'm not sure I could offer any other suggestions. If 
> neither of those is the case, I'd need a working example.
>
> -Steve



More information about the Digitalmars-d-learn mailing list