Jump to content
Registration disabled at the moment Read more... ×
Sign in to follow this  
Lars Fosdal

RTTI, determine record helper type for a base type

Recommended Posts

Consider

type
  TSomeType = (One, Two Three);
  TSomeTypeHelper = record helper for TSomeType
    class function Values: TArray<string>;
  end;

 

Can I use RTTI to find the record helper type for TSomeType and the Values function?

 

Reason: I'd like to call Values  - which would be a naming convention (since record helpers can't be inherited or generic) - for any type that has a record helper with a class function named Values.

Share this post


Link to post

No, unless you reference the helper type itself somewhere which you typically don't and if you do you can just register the function somewhere so you don't need to use RTTI.

Share this post


Link to post

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×