Variable shadowing bug?

denizzz 4.deniz.z.z at gmail.com
Tue Jun 11 19:01:25 PDT 2013


On Wednesday, 12 June 2013 at 01:17:50 UTC, Mike Parker wrote:
> On Tuesday, 11 June 2013 at 16:37:18 UTC, denizzz wrote:
>
>>
>> sfTime* r = sfClock_getElapsedTime(sfPtr);
>>
>> says what sfTime can not be implictly converted to sfTime
>
> sfClock_getElapsedTime does not return a pointer.
>
> You're going to continue to have type mismatches because you 
> are trying to use two different types interchangeably.

Ok, but why compiler says that types of these types is equal?
It should say something about shadowing of variable?

> Your sfTime declared in your dsfml.system module is *not* the 
> same type as the one declared in Derelict.

I understand that and already removed this code. (It was left by 
mistake - I am changing SFML-D for use with Derelict3)

> sfClock_getElapsedTime does *not* return a dsfml.system.sftime, 
> but a derelict.sfml2.system.types.sfTime.  I strongly suggest 
> you get rid of your redundant types and just publicly import 
> derelict.sfml2.system.types to avoid this sort of error.

"sfTime", not "sftime".

/usr/include/dmd/derelict/sfml2/systemfunctions.d:    alias 
nothrow sfTime function(const(sfClock*) clock) 
da_sfClock_getElapsedTime;


More information about the Digitalmars-d-learn mailing list