Facing problems with Class Properties

Steven Schveighoffer schveiguy at yahoo.com
Mon Dec 13 06:37:52 PST 2010


On Fri, 10 Dec 2010 20:22:52 -0500, d coder <dlang.coder at gmail.com> wrote:

>> Another thing, is(T : U) simply means T is implicitly castable to U.  
>>  Due to
>> a compiler bug, Bar[] is implicitly castable to BaseClass[].
>>
>
> Steve
>
> I realize that I am using this compiler bug as a feature. It would be
> kind of you to suggest me a code that would not exploit this bug. I
> was thinking of using something to the effect:
>
> if (__traits(isStaticArray, this.tupleof[i]) {
>   if (is (typeof(this.tupleof[i][0]) : BaseModule)) {


Just use is(T == U) instead of is(T : U)

-Steve


More information about the Digitalmars-d-learn mailing list