mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[ASTGen] Fix SetterAccessAttr e.g. private(set)
'set' part was not parsed as a keyword. Let's just compare the text.
This commit is contained in:
@@ -1983,7 +1983,10 @@ extension ASTGenVisitor {
|
||||
-> BridgedDeclAttribute?
|
||||
{
|
||||
if let detail = node.detail {
|
||||
precondition(detail.detail.keywordKind == .set, "only accepted modifier argument is '(set)'")
|
||||
guard detail.detail.rawText == "set" else {
|
||||
// TODO: Diagnose
|
||||
fatalError("only accepted modifier argument is '(set)'")
|
||||
}
|
||||
return BridgedSetterAccessAttr.createParsed(
|
||||
self.ctx,
|
||||
range: self.generateSourceRange(node),
|
||||
|
||||
@@ -141,6 +141,8 @@ struct TestVars {
|
||||
var s: Int {
|
||||
get async throws { return 0 }
|
||||
}
|
||||
|
||||
private(set) var testPrivateSet = 1
|
||||
}
|
||||
|
||||
extension TestVars {
|
||||
|
||||
Reference in New Issue
Block a user