Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
throw if boolean value isn't explicitly true or false
  • Loading branch information
brettfo committed Sep 20, 2017
commit 4f321fdd31976d7db8a0179efa5e5dde7232c483
6 changes: 5 additions & 1 deletion src/fsharp/FSharp.Build/FSharpEmbedResXSource.fs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,11 @@ module internal {1} =
let getBooleanMetadata (metadataName:string) (defaultValue:bool) (item:ITaskItem) =
match item.GetMetadata(metadataName) with
| value when String.IsNullOrWhiteSpace(value) -> defaultValue
| value -> String.Compare(value, "true", StringComparison.OrdinalIgnoreCase) = 0
| value ->
match value.ToLowerInvariant() with
| "true" -> true
| "false" -> false
| _ -> failwith (sprintf "Expected boolean value for '%s' found '%s'" metadataName value)
let mutable success = true
let generatedSource =
[| for item in this.EmbeddedResource do
Expand Down