We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 635675b commit 4219b78Copy full SHA for 4219b78
Sources/AssociatedObjectPlugin/AssociatedObjectMacro.swift
@@ -330,24 +330,17 @@ extension AssociatedObjectMacro {
330
"let oldValue = \(identifier)"
331
}
332
333
+ """
334
+ setAssociatedObject(
335
+ self,
336
+ \(associatedKey),
337
+ newValue,
338
+ \(policy)
339
+ )
340
341
if type.isOptional, hasDefaultValue {
342
"""
- setAssociatedObject(
- self,
- \(associatedKey),
- newValue,
- \(policy)
- )
- self.__associated_\(identifier.trimmed)IsSet = true
- """
343
- } else {
344
345
346
347
348
349
350
+ self.__associated_\(identifier.trimmed)IsSet = true
351
352
353
0 commit comments