From cc85990a8720b525bc17aa5c5c8e6b8c6afd5017 Mon Sep 17 00:00:00 2001 From: Wolfgang Lutz Date: Mon, 22 Jan 2024 19:23:59 +0100 Subject: [PATCH] Make SetValue more Generic by using Self instead of State MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit otherwise, this only works on Structs called “State” --- Sources/ChangeableMacros/ChangeableMacro.swift | 2 +- .../ChangeableTests/Resources/testChangeable/Output.swift.test | 2 +- .../Resources/testChangeableWithComment/Output.swift.test | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/ChangeableMacros/ChangeableMacro.swift b/Sources/ChangeableMacros/ChangeableMacro.swift index 5f84650..556d20a 100644 --- a/Sources/ChangeableMacros/ChangeableMacro.swift +++ b/Sources/ChangeableMacros/ChangeableMacro.swift @@ -66,7 +66,7 @@ public struct ChangeableFunctionMacro: MemberMacro { .joined(separator: ",\n ") let applyDeclaration: DeclSyntax = """ - public func apply(action: SetValue) -> Self { + public func apply(action: SetValue) -> Self { let path = action.path let value = action.value diff --git a/Tests/ChangeableTests/Resources/testChangeable/Output.swift.test b/Tests/ChangeableTests/Resources/testChangeable/Output.swift.test index 01c1926..fdffdd3 100644 --- a/Tests/ChangeableTests/Resources/testChangeable/Output.swift.test +++ b/Tests/ChangeableTests/Resources/testChangeable/Output.swift.test @@ -15,7 +15,7 @@ b != nil ) } - public func apply(action: SetValue) -> Self { + public func apply(action: SetValue) -> Self { let path = action.path let value = action.value diff --git a/Tests/ChangeableTests/Resources/testChangeableWithComment/Output.swift.test b/Tests/ChangeableTests/Resources/testChangeableWithComment/Output.swift.test index 7584330..e290978 100644 --- a/Tests/ChangeableTests/Resources/testChangeableWithComment/Output.swift.test +++ b/Tests/ChangeableTests/Resources/testChangeableWithComment/Output.swift.test @@ -18,7 +18,7 @@ b != nil ) } - public func apply(action: SetValue) -> Self { + public func apply(action: SetValue) -> Self { let path = action.path let value = action.value