Skip to content

Fix GH-9420: Avoid invalid use of internal attributes on promoted properties #9661

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

kooldev
Copy link
Contributor

@kooldev kooldev commented Oct 3, 2022

Internal attributes may cause compilation errors when used on promoted properties. This was reported in #9420. This PR fixes the reported bug by dropping unsupported internal attributes during compilation of promoted properties. This works for attributes that apply to a parameter but not a property (has been reported as bug). It also fixes the situation where an attribute applies to a property but not a parameter (not yet reported as bug).

Userland attributes are not affected by this change and unfortunately (due to the way they are implemented) cannot be fixed in the same way.

@adoy
Copy link
Member

adoy commented Oct 27, 2022

Looks good to me ! Thanks

@nicolas-grekas
Copy link
Contributor

This change makes sense to me. Userland attributes don't have this issue because they're read (thus checked) on demand. An alternate approach might be to read internal attributes on demand also, but this might be more involving. This would allow using eg SensitiveParameter on properties since they then would be unchecked. On the other hand, the approach in this PR makes checking for the location of internal attributes more strict.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants