Skip to content

Conversation

@xedin
Copy link
Contributor

@xedin xedin commented Feb 7, 2026

Follow-up to #86967.

The callers are responsible for constructing declarations that are valid, let's double-check that all of the attached attributes to the declaration can indeed appear on it before printing instead of simply skipping them.

Follow-up to swiftlang#86967.

The callers are responsible for constructing declarations
that are valid, let's double-check that all of the attached
attributes to the declaration can indeed appear on it before
printing instead of simply skipping them.
@xedin
Copy link
Contributor Author

xedin commented Feb 7, 2026

@swift-ci please test

@xedin
Copy link
Contributor Author

xedin commented Feb 7, 2026

@swift-ci please test source compatibility

@slavapestov
Copy link
Contributor

IMO we should assert this when we add an attribute to a Decl

@xedin
Copy link
Contributor Author

xedin commented Feb 8, 2026

That makes sense, I just want to see what breaks before I do a bigger refactoring here.

@xedin
Copy link
Contributor Author

xedin commented Feb 8, 2026

IMO we should assert this when we add an attribute to a Decl

@slavapestov Moving this to attachToDecl is too early because attribute verifier diagnoses some of the wrong uses and it's intentional that wrong attributes appear on the declaration. This has to be double-checked at the point where the verifier is done with the declaration I think.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants