Skip to content

Commit

Permalink
Add an explicit return type to flatMap closure. (apple#490)
Browse files Browse the repository at this point in the history
This restores the ability to build with versions of Swift prior to 5.7.
  • Loading branch information
allevato committed Sep 17, 2022
1 parent 7506042 commit 841b853
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/ArgumentParser/Parsable Properties/Flag.swift
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ extension Flag where Value: EnumerableFlag {
// Create a string representation of the default value. Since this is a
// flag, the default value to show to the user is the `--value-name`
// flag that a user would provide on the command line, not a Swift value.
let defaultValueFlag = initial.flatMap { value in
let defaultValueFlag = initial.flatMap { value -> String? in
let defaultKey = InputKey(rawValue: String(describing: value))
let defaultNames = Value.name(for: value).makeNames(defaultKey)
return defaultNames.first?.synopsisString
Expand Down

0 comments on commit 841b853

Please sign in to comment.