Skip to content

Commit 5080a3b

Browse files
committed
Fixed incorrect doc comments
1 parent 6435a7e commit 5080a3b

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

Sources/SyncMacros/SyncMacro.swift

+6-2
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,15 @@ extension SyncMacro: PeerMacro {
121121
guard let binding = declaration.bindings.first, declaration.bindings.count == 1 else {
122122
throw SyncMacroError.unsupportedNumberOfBindings
123123
}
124+
125+
guard let bindingIdentifier = binding.pattern.as(IdentifierPatternSyntax.self) else {
126+
throw SyncMacroError.invalidPattern
127+
}
124128

125129
return [
126130
"""
127-
/// The backing storage for the ``\(binding.trimmed)`` property.
128-
/// - Note: The value of this property is not synchronized with the parent. Use the ``\(binding.trimmed)`` property instead.
131+
/// The backing storage for the ``\(bindingIdentifier.trimmed)`` property.
132+
/// - Note: The value of this property is not synchronized with the parent. Use the ``\(bindingIdentifier.trimmed)`` property instead.
129133
private var _\(binding.trimmed)
130134
"""
131135
]

Tests/SyncTests/SyncTests.swift

+4-4
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ final class SyncTests: XCTestCase {
4545
}
4646
}
4747
48-
/// The backing storage for the ``foo: Int`` property.
49-
/// - Note: The value of this property is not synchronized with the parent. Use the ``foo: Int`` property instead.
48+
/// The backing storage for the ``foo`` property.
49+
/// - Note: The value of this property is not synchronized with the parent. Use the ``foo`` property instead.
5050
private var _foo: Int
5151
"""#
5252
}
@@ -89,8 +89,8 @@ final class SyncTests: XCTestCase {
8989
}
9090
}
9191
92-
/// The backing storage for the ``foo: Int?`` property.
93-
/// - Note: The value of this property is not synchronized with the parent. Use the ``foo: Int?`` property instead.
92+
/// The backing storage for the ``foo`` property.
93+
/// - Note: The value of this property is not synchronized with the parent. Use the ``foo`` property instead.
9494
private var _foo: Int?
9595
"""#
9696
}

0 commit comments

Comments
 (0)