Skip to content

Commit

Permalink
Elevate debug assert to release mode as well (#3030)
Browse files Browse the repository at this point in the history
* Elevate debug assert to runtime

* Format
  • Loading branch information
Smaug123 committed Dec 29, 2023
1 parent fc341e8 commit a999b77
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Fantomas.Core/ASTTransformer.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1629,7 +1629,9 @@ let mkTuplePat (creationAide: CreationAide) (pats: SynPat list) (commas: range l
| [] -> failwith "SynPat.Tuple with no elements"
| head :: tail ->
let rest =
assert (tail.Length = commas.Length)
if tail.Length <> commas.Length then
failwith
$"Number of elements in tail of tuple (%i{tail.Length}) was not equal to number of commas (%i{commas.Length}), at range %O{m}."

List.zip commas tail
|> List.collect (fun (c, e) -> [ yield Choice2Of2(stn "," c); yield Choice1Of2(mkPat creationAide e) ])
Expand Down

0 comments on commit a999b77

Please sign in to comment.