You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
AttributeUsage AllowMultiple and AttributeTargets is not inherited #9256
changed the title [-]AttributeUsage AllowMultiple is not inherited[/-][+]AttributeUsage AllowMultiple and AttributeTargets is not inherited[/+]on Sep 3, 2020
I've been looking into fixing this issue, but I have some issues understanding exactly how to do this. I know that the AllowMultiple check is being done in the CheckAttribs function (source). That function then calls the TryFindAttributeUsageAttribute function which is defined here, which itself depends on TryBindTyconRefAttribute (source). It does indeed look like the code never checks if the attribute itself has inherited attributes. My main question is: how can I best approach this? I've tried to get to an attribute's parent type, but so far have failed in my attempts.
Activity
dsyme commentedon Sep 3, 2020
Agreed we should be looking at the inherited
AttributeUsage[-]AttributeUsage AllowMultiple is not inherited[/-][+]AttributeUsage AllowMultiple and AttributeTargets is not inherited[/+]ErikSchierboom commentedon Dec 30, 2020
I've been looking into fixing this issue, but I have some issues understanding exactly how to do this. I know that the
AllowMultiplecheck is being done in theCheckAttribsfunction (source). That function then calls theTryFindAttributeUsageAttributefunction which is defined here, which itself depends onTryBindTyconRefAttribute(source). It does indeed look like the code never checks if the attribute itself has inherited attributes. My main question is: how can I best approach this? I've tried to get to an attribute's parent type, but so far have failed in my attempts.baronfel commentedon Jan 4, 2021
@ErikSchierboom take a look at PR 10834, I made a helper function that walks the inheritance hierarchy for a type that seems to do the job.
ErikSchierboom commentedon Jan 4, 2021
@baronfel Ah interesting! Thanks for the heads-up.