mirror of
https://github.com/nim-lang/Nim.git
synced 2026-05-04 04:54:49 +00:00
* fix #9423 distinct generics now work in vm
* fixes cpp tests
---------
Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
(cherry picked from commit deaf684375)
This commit is contained in:
@@ -232,12 +232,7 @@ proc fromJson*[T](a: var T, b: JsonNode, opt = Joptions()) =
|
||||
elif T is uint|uint64: a = T(to(b, uint64))
|
||||
elif T is Ordinal: a = cast[T](to(b, int))
|
||||
elif T is pointer: a = cast[pointer](to(b, int))
|
||||
elif T is distinct:
|
||||
when nimvm:
|
||||
# bug, potentially related to https://github.com/nim-lang/Nim/issues/12282
|
||||
a = T(jsonTo(b, distinctBase(T)))
|
||||
else:
|
||||
a.distinctBase.fromJson(b)
|
||||
elif T is distinct: a.distinctBase.fromJson(b)
|
||||
elif T is string|SomeNumber: a = to(b,T)
|
||||
elif T is cstring:
|
||||
case b.kind
|
||||
|
||||
Reference in New Issue
Block a user