Cast to subclass in the dmd compiler

Jacob Carlborg via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Jul 25 23:50:21 PDT 2017


On 2017-07-25 23:06, unDEFER wrote:
> I have found the answer in the code.
> Right code is:
> 
> Import imp = m.isImport();
> if (imp !is null)
> 
> Thank you.

That's the correct solution. For Expression, there's a field called "op" 
that indicates what kind of expression it is, which can used in 
combination with a cast.

-- 
/Jacob Carlborg


More information about the Digitalmars-d-learn mailing list