Skip to content

Commit 841b853

Browse files
authored
Add an explicit return type to flatMap closure. (#490)
This restores the ability to build with versions of Swift prior to 5.7.
1 parent 7506042 commit 841b853

File tree

1 file changed

+1
-1
lines changed
  • Sources/ArgumentParser/Parsable Properties

1 file changed

+1
-1
lines changed

Sources/ArgumentParser/Parsable Properties/Flag.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ extension Flag where Value: EnumerableFlag {
395395
// Create a string representation of the default value. Since this is a
396396
// flag, the default value to show to the user is the `--value-name`
397397
// flag that a user would provide on the command line, not a Swift value.
398-
let defaultValueFlag = initial.flatMap { value in
398+
let defaultValueFlag = initial.flatMap { value -> String? in
399399
let defaultKey = InputKey(rawValue: String(describing: value))
400400
let defaultNames = Value.name(for: value).makeNames(defaultKey)
401401
return defaultNames.first?.synopsisString

0 commit comments

Comments
 (0)