Skip to content

Commit

Permalink
Print value of SynConst.UserNum as string.
Browse files Browse the repository at this point in the history
  • Loading branch information
nojaf committed Apr 19, 2020
1 parent 83073f2 commit 79e152f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/Fantomas.Tests/SynConstTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,9 @@ module Runner =
class
end
"""

[<Test>]
let ``array literals of BigInteger, 682`` () =
formatSourceString false "let input = [| 1I;0I;-1I |]" config
|> should equal "let input = [| 1I; 0I; -1I |]
"
2 changes: 1 addition & 1 deletion src/Fantomas/CodePrinter.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2705,7 +2705,7 @@ and genConstNumber (c:SynConst) (r: range) =
| SynConst.Decimal(v) -> !- (sprintf "%A" v)
| SynConst.IntPtr(v) -> !- (sprintf "%A" v)
| SynConst.UIntPtr(v) -> !- (sprintf "%A" v)
| SynConst.UserNum(v,s) -> !- (sprintf "%A%s" v s)
| SynConst.UserNum(v,s) -> !- (sprintf "%s%s" v s)
| _ -> failwithf "Cannot generating Const number for %A" c
<| ctx

Expand Down

0 comments on commit 79e152f

Please sign in to comment.