We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi
I am facing the following error
// sourcery: MyAutoMockable protocol UserNotificationCenterProtocol { func add( _ request: UNNotificationRequest, withCompletionHandler completionHandler: (((any Error)?) -> Void)? ) }
final class UserNotificationCenterMock: UserNotificationCenterProtocol { func add( _ request: UNNotificationRequest, withCompletionHandler completionHandler: ((any Error?) -> Void)? // error: optional 'any' type must be written '(any Error)?' ) { ... } }
{{ method.name }} value
{{ method.name }}
add(_ request: UNNotificationRequest, withCompletionHandler completionHandler: ((any Error?) -> Void)?)
{{ method }} value
{{ method }}
<<Method: name = add(_ request: UNNotificationRequest, withCompletionHandler completionHandler: ((any Error?) -> Void)?), selectorName = add(_:withCompletionHandler:), parameters = [MethodParameter: argumentLabel = nil, name = request, typeName = UNNotificationRequest, `inout` = false, isVariadic = false, typeAttributes = [:], defaultValue = nil, annotations = [:], asSource = _ request: UNNotificationRequest, index = 0, MethodParameter: argumentLabel = Optional("withCompletionHandler"), name = completionHandler, typeName = ((any Error?) -> Void)?, `inout` = false, isVariadic = false, typeAttributes = [:], defaultValue = nil, annotations = [:], asSource = withCompletionHandler completionHandler: ((any Error?) -> Void)?, index = 1], returnTypeName = Void, isAsync = false, `throws` = false, `rethrows` = false, accessLevel = internal, isStatic = false, isClass = false, isFailableInitializer = false, annotations = [:], documentation = [], definedInTypeName = Optional(UserNotificationCenterProtocol), attributes = [:], modifiers = [], genericRequirements = [], genericRequirements = []>>
I am using Sourcery 2.2.5 and Xcode 16.
The text was updated successfully, but these errors were encountered:
I currently workaround this issue by applying the following patch
{%- macro fixOptionalAny str -%} {{ str|replace:"any (\w+)\?","(any $1)?","regex" }} {%- endmacro -%}
Sorry, something went wrong.
No branches or pull requests
Hi
I am facing the following error
{{ method.name }}
value{{ method }}
valueI am using Sourcery 2.2.5 and Xcode 16.
The text was updated successfully, but these errors were encountered: