Templates lots of newbie qs.

Jarrett Billingsley kb3ctd2 at yahoo.com
Thu Mar 8 15:33:48 PST 2007


"Chris Warwick" <sp at m.me.not> wrote in message 
news:esq357$2b0j$1 at digitalmars.com...
>
> But works fine if I rename the template. Iirc from the docs local scope 
> overrides mixins, so perhaps thats what is happening,

That's exactly what's happening.  Name lookup goes from the inside out, so 
the compiler finds the class method first, which only takes one parameter, 
not two.

> Yeah but the problem is i am using it as an Array Property so it's already 
> got a dot to seperate it from the array.

Well keep in mind that

fwidgets.indexOf(foo);

is just syntactic sugar for:

indexOf(fwidgets, foo);

When you write a function that takes an array as the first parameter, it 
does not mean you are extending the array types.  It's entirely sugar, and 
function lookup still happens as normal -- from the local scope up.  So all 
you have to do is rewrite the function call from the property way into the 
function call way, and use the dot operator to access the globally-scoped 
symbol. 




More information about the Digitalmars-d-learn mailing list