Open nysander opened 3 months ago
Hi, thanks for reporting. I can't reproduce this issue with just that line in isolation, so it's probably dependent on the surrounding context from the file and/or your particular configuration settings.
Can you provide a standalone sample I can use to reproduce the issue? Either the whole source file, or a portion of it. It doesn't matter if it doesn't compile on its own.
protocol RemoteNotificationHandler {
typealias FetchCompletionBlock = (UIBackgroundFetchResult) -> Void
typealias RemoteNotification = [AnyHashable: Any]
func handle(remoteNotification: RemoteNotification, completion: @escaping FetchCompletionBlock)
func register(_ delegate: RemoteNotificationHandlerDelegate)
func unregister(_ delegate: RemoteNotificationHandlerDelegate)
}
similar example just when removed parenthesis from typealias FetchCompletionBlock = (UIBackgroundFetchResult) -> Void
line Xcode shows this error without compiling the code
generally its completion with parameter
my config
--exclude Package.swift
--disable wrapMultilineStatementBraces
--disable unusedArguments
--disable trailingCommas
--disable strongOutlets
--disable preferForLoop
--enable blankLineAfterImports
--enable isEmpty,
--enable wrapEnumCases,
--enable wrapSwitchCases
--enable redundantProperty
--enable blankLineAfterSwitchCase
--enable organizeDeclarations
--patternlet inline
--indentcase true
--indent 4
--emptybraces spaced
--ranges no-space
--self init-only
@nysander I'm still not able to reproduce - can you verify which version of swiftformat you are running?
latest 0.54.0
@nysander I'm still unable to repro this - sorry.
Perhaps you could try opening a PR with a unit test or snapshot that demonstrates the problem?
I will try to create some test project to extract this issue
Original code
Fixed
Xcode error:
Single argument function types require parentheses