Skip to content

Commit 1550ddc

Browse files
committed
fix json format when values are implicitly casted
1 parent 0e7008a commit 1550ddc

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

nix/_formats/json/serialize.nix

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
_:
2+
3+
x: builtins.fromJSON (builtins.toJSON x)

tests/_snapshots/implicit

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#json
2+
"foo"

tests/implicit/expr.nix

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
__toString = _: "foo";
3+
}

0 commit comments

Comments
 (0)