compiler message cannot convert GType to GType

Ant duitoolkit at yahoo.ca
Sun Mar 12 15:29:59 PST 2006


Unknown W. Brackets wrote:
> Actually, I think I saw this once... or twice.  It was a dumb mistake of 
> mine, though.  It requires multiple files.
> 
> File #1, test1.d:
> ---
> import test2;
> typedef int test;
> 
> void main()
> {
>     test1.test x = 5;
>     foo(x);
> }
> 
> void foo(test2.test y)
> {
> }
> ---
> 
> File #2, test2.d:
> ---
> typedef int test;
> ---
> 
> But that's not this problem.  I think this one is:
> 
> File #3, test3.d:
> ---
> import test2;
> typedef int test;
> 
> void main()
> {
>     test3.test x = 5;
>     test2.test y = x;
> }
> ---
> 
> Which produces the same error message.  In actuality, the compiler is 
> 100% correct - the two cannot be implicitly cast.  However, the error 
> message is VERY ambiguous.
> 
> As you can tell, the root of the problem is that the error message 
> doesn't use fully-qualified type names.  Personally, I like this better, 
> but maybe at least for these sort of cases, they need to be 
> fully-qualified.
> 
> Ant, do you think this is the issue you are running into?
> 

I already fixed it, thank you! :)

(the same enum was defined in different files.)

One of the problems is that I'm breaking my own rule of never, ever
define anything outside a class.
D is unusable if you don't encapsulate every thing in classes.
(of course every thing I say is my opinion).

BTW I've being frequenting the IRC D channel lately and found
that others have faced some of the problems I am complaining for 2 years
but they just keep silent.

I found D excellent but DMD still very immature...
barely usable - but that's why it's still beta, of course.

Ant



More information about the Digitalmars-d-bugs mailing list