-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Add a Fix-It to the warning about unnecessary @preconcurrency
conformance
#73742
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -147,7 +147,7 @@ SourceLoc TypeRepr::findAttrLoc(TypeAttrKind kind) const { | |
for (auto attr : attrTypeRepr->getAttrs()) { | ||
if (auto typeAttr = attr.dyn_cast<TypeAttribute*>()) | ||
if (typeAttr->getKind() == kind) | ||
return typeAttr->getAttrLoc(); | ||
return typeAttr->getStartLoc(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was looking for what this change is going to affect and found https://github.com/apple/swift/blob/main/lib/Sema/TypeCheckDeclPrimary.cpp#L1803-L1806 which instead of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure, I'll do that. I feel like there should be a better way than that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What devilry is this? The There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That is weird... |
||
} | ||
|
||
typeRepr = attrTypeRepr->getTypeRepr(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please add an assert to make sure that
preconcurrencyLoc
is never valid whenisPreconcurrency
is set tofalse
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, good idea!