Skip to content

Commit

Permalink
update swift-syntax, remove deprecation warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
lukepistrol committed Nov 9, 2023
1 parent 728ac4c commit ad2183d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-syntax.git",
"state" : {
"revision" : "74203046135342e4a4a627476dd6caf8b28fe11b",
"version" : "509.0.0"
"revision" : "6ad4ea24b01559dde0773e3d091f1b9e36175036",
"version" : "509.0.2"
}
}
],
Expand Down
8 changes: 4 additions & 4 deletions Sources/SFSymbolsMacroImpl/SFSymbolsMacro.swift
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ public struct SFSymbolMacro: MemberMacro {
.init(node: Syntax(declaration), message: SFSymbolDiagnostic.notAnEnum)
])
}
let identifier = enumDecl.identifier
guard enumDecl.inheritanceClause?.inheritedTypeCollection.contains(where: {
$0.typeName.as(SimpleTypeIdentifierSyntax.self)?.name.text == "String"
let identifier = enumDecl.name
guard enumDecl.inheritanceClause?.inheritedTypes.contains(where: {
$0.type.as(IdentifierTypeSyntax.self)?.name.text == "String"
}) ?? false else {
throw DiagnosticsError(diagnostics: [
.init(node: Syntax(identifier), message: SFSymbolDiagnostic.missingStringProtocolConformance(symbol: identifier.text))
Expand All @@ -89,7 +89,7 @@ public struct SFSymbolMacro: MemberMacro {
let idNode = $0.rawValue?.value.as(StringLiteralExprSyntax.self)?.segments.first {
$0.as(StringSegmentSyntax.self) != nil
}
let id = idNode?.as(StringSegmentSyntax.self)?.content.text ?? $0.identifier.text
let id = idNode?.as(StringSegmentSyntax.self)?.content.text ?? $0.name.text
let syntax = Syntax(enumCase)
return (id: id, node: syntax)
}
Expand Down

0 comments on commit ad2183d

Please sign in to comment.