Skip to content

Commit

Permalink
Improve error message for invalid enums with only one case
Browse files Browse the repository at this point in the history
Christer van der Meeren committed Dec 21, 2023

Verified

This commit was signed with the committer’s verified signature.
scala-steward Scala Steward
1 parent e30bd11 commit 509c0f5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Felicity/Errors.fs
Original file line number Diff line number Diff line change
@@ -323,7 +323,7 @@ let invalidParsedErrMsg (info: ParsedValueInfo) errMsg =
let invalidEnum (info: ParsedValueInfo) allowedValues =
let expectedStr =
match allowedValues with
| [ x ] -> x
| [ x ] -> $"'%s{x}'"
| xs -> "one of " + (xs |> List.map (sprintf "'%s'") |> String.concat ", ")

match info with

0 comments on commit 509c0f5

Please sign in to comment.