Interesting, I didn't knew about that!
Interesting, I didn't knew about that!
While the EMBT doc explains it as shortening, it seems to be implemented as an implicit lengthening test actually (tested wit MyAttribute and MyAttributeAttribute)
Originally shared by ITDevCon European Delphi Conference
Using attributes and #RTTI to automate programming tasks with Primož Gabrijelčič
Can't this cause serious ambiguity issues?
ReplyDeleteAFAICT, when you write [Something], the compiler first searches for "SomethingAttribute", and if not found, it searches for "Something". So effectively if you have both declared, the version without the "Attribute" postfix isn't accessible anymore (as an attribute).
ReplyDeleteI think it is the good practice always to name attribute classes with Attribute suffix and without T class prefix;
ReplyDeleteso, no issues here.
I was in that room this morning! :O
ReplyDeleteIf declare MyAttribute and My, 'My' is never chosen by rtti...
This is the same behaviour as in .Net!
ReplyDelete