www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Re: DIP6: Attributes

reply Kagamin <spam here.lot> writes:
grauzone Wrote:

 inheritance?

You want to inherit annotations? What for?

Backward compatibility: obtain annotation cast it, work with it, then later change its type. Annotations will be used by reflection, so classinfo will be useful.
Aug 04 2009
parent grauzone <none example.net> writes:
Kagamin wrote:
 grauzone Wrote:
 
 inheritance?


Backward compatibility: obtain annotation cast it, work with it, then later change its type. Annotations will be used by reflection, so classinfo will be useful.

Code can do that at compiletime. No need for casting, because the tuple returned by __traits will use the "correct" types directly. For runtime, I have no idea. The D crowd seems to prefer compile time. We got __traits instead of more detailed TypeInfo/ClassInfo. If you want to do runtime stuff, you'll have to generate your own RTTI using compile time code.
Aug 04 2009