summary refs log tree commit diff stats
path: root/lib/pure
diff options
context:
space:
mode:
authorringabout <43030857+ringabout@users.noreply.github.com>2023-05-10 17:06:14 +0800
committerGitHub <noreply@github.com>2023-05-10 11:06:14 +0200
commitdeaf6843752112cfaadc688302c94779d633c686 (patch)
tree6a15079afca37a564ea73b4e1ee1bf51055c319b /lib/pure
parent4b76037e5fe14f75ac5381a0d08ad509f450cf56 (diff)
downloadNim-deaf6843752112cfaadc688302c94779d633c686.tar.gz
fix #9423 followup #17594: distinct generics now work in VM (#21816)
* fix #9423 distinct generics now work in vm

* fixes cpp tests

---------

Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
Diffstat (limited to 'lib/pure')
-rw-r--r--lib/pure/json.nim8
1 files changed, 1 insertions, 7 deletions
diff --git a/lib/pure/json.nim b/lib/pure/json.nim
index 7ccd3c43f..b68ddd660 100644
--- a/lib/pure/json.nim
+++ b/lib/pure/json.nim
@@ -1211,13 +1211,7 @@ macro assignDistinctImpl[T: distinct](dst: var T;jsonNode: JsonNode; jsonPath: v
   let baseTyp = typImpl[0]
 
   result = quote do:
-    when nimvm:
-      # workaround #12282
-      var tmp: `baseTyp`
-      initFromJson( tmp, `jsonNode`, `jsonPath`)
-      `dst` = `typInst`(tmp)
-    else:
-      initFromJson( `baseTyp`(`dst`), `jsonNode`, `jsonPath`)
+    initFromJson(`baseTyp`(`dst`), `jsonNode`, `jsonPath`)
 
 proc initFromJson[T: distinct](dst: var T; jsonNode: JsonNode; jsonPath: var string) =
   assignDistinctImpl(dst, jsonNode, jsonPath)