Bug?

Steven Schveighoffer schveiguy at gmail.com
Mon May 11 13:06:59 UTC 2020


On 5/11/20 8:44 AM, Jack Applegame wrote:
> On Monday, 11 May 2020 at 12:30:22 UTC, Adam D. Ruppe wrote:
>> UFCS is only defined to work with global scope functions. A restricted 
>> import (module : symbol, symbols) puts things in local scope so ufcs 
>> doesn't apply.
> 
> But in this case the error should be displayed for lines 4 and 5, not 11.
> Line 11 contains a call to a member function, not UFCS.
> 
> In addition, if you add the parentheses, then it works:
> assert(rng.front() == '1');
> 
> 

Yeah, this is definitely a bug. If I change the return type of front to 
dchar from auto, it still thinks it's returning void.

Calling things like popFront without parentheses has an error 
"rng.popFront has no effect".

Clearly something isn't connecting properly, it's almost like it's 
resolving to the function itself instead of calling it.

-Steve


More information about the Digitalmars-d-learn mailing list