Variable shadowing bug?

Mike Parker aldacron at gmail.com
Tue Jun 11 06:45:55 PDT 2013


On Tuesday, 11 June 2013 at 08:08:03 UTC, denizzz wrote:

>
> sfClock_getElapsedTime return type actually defined in the 
> another file, typeid = 
> _D45TypeInfo_S8derelict5sfml211systemtypes6sfTime6__initZ
>
> compilation causes:
>
> dsfml/system.d(54): Error: static assert  (is(sfTime == 
> sfTime)) is false
>
> This message looks weird. I am spent hour to find this bug. :-(

This is essentially what you are doing:

static assert( is (derelict.sfml2.system.types.sfTime == 
dsfml.system.sfTime) );

They are two different types. It should pass you change your 
assert to this:

is(typeof(r)==derelict.sfml2.system.types.sfTime)

On another note not related to your problem, you have a redundant 
import at the top of your system module. derelict.sfml2.system 
publicly imports the system.types module, so you don't have to.




More information about the Digitalmars-d-learn mailing list