Some quick questions
Carlos Santander
csantander619 at gmail.com
Wed Aug 8 16:34:15 PDT 2007
Márcio Faustino escribió:
> BCS wrote:
>> The reason that doesn’t work is that the uses of union there is a type
>> deceleration, not a member declaration. So you get a struct without
>> any content.
>>
>> (...)
>
> How dumb of me :-| sorry.
>
> Here's another question, given these 2 files:
> // F1.d -------------------------
> module F1;
> import F2;
>
alias F2.f f;
> void f(int i, int j) {}
> void main() { f(1); }
>
> // F2.d -------------------------
> module F2;
>
> void f(int i) {}
>
> Why does the compiler says:
> function F1.f (int,int) does not match parameter types (int)
> Error: expected 2 arguments, not 1
>
> Looks like the import of F2 isn't working, because if I replace f(1)
> with F2.f(1), it works ok.
>
> Thanks!
This is normal D behavior due to its look-up rules. I'm sure someone else will
give you a more detailed explanation.
--
Carlos Santander Bernal
More information about the Digitalmars-d-learn
mailing list