Help me investigate a bug to file it.

Artur Skawina art.08.09 at gmail.com
Mon Jul 8 17:06:00 PDT 2013


On 07/09/13 00:43, Artur Skawina wrote:
> On 07/08/13 23:45, monarch_dodra wrote:
>> But, the "context pointer" *should* be defined as whatever the owner of the indexing/slicing object is, no? In this case, it's simply _input. It has nothing to do with the "this" pointer being available...
>>
>> If anything, it kind of worries me about *what* the implementation is doing with the this pointer, but I haven't been able to "trick" it into calling a wrong function.
> 
> It's just like

Sorry, didn't read that code again before replying. What is
indeed unintuitive is that the first typeof expression succeeds
but the other one fails. But this is related to how typeof() works,
apparently by design. Eg:

   auto f(int a) { return a; }
   pragma(msg, typeof(f(1))); // "int". OK.
   alias INT = int;
   pragma(msg, typeof(f(INT))); // "int". OK...
   //pragma(msg, typeof(f(int))); // Compile error. 
   
That plus a non-existing this._input, results in a bit (too much)
magic, and the first test passes. The other one fails because of
the '$' (ie opDollar() call).

artur


More information about the Digitalmars-d-learn mailing list