remove legacy code (#21134)

* remove legacy code

* fixes
This commit is contained in:
ringabout 2022-12-26 20:20:05 +08:00 • committed by GitHub
commit f7c203fb6c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
27 changed files with 432 additions and 1032 deletions

View file

@ -37,22 +37,8 @@ from typetraits import OrdinalEnum, tupleLen
when defined(nimPreviewSlimSystem):
import std/assertions
when not defined(nimFixedForwardGeneric):
# xxx remove pending csources_v1 update >= 1.2.0
proc to[T](node: JsonNode, t: typedesc[T]): T =
when T is string: node.getStr
elif T is bool: node.getBool
else: static: doAssert false, $T # support as needed (only needed during bootstrap)
proc isNamedTuple(T: typedesc): bool = # old implementation
when T isnot tuple: result = false
else:
var t: T
for name, _ in t.fieldPairs:
when name == "Field0": return compiles(t.Field0)
else: return true
return false
else:
proc isNamedTuple(T: typedesc): bool {.magic: "TypeTrait".}
proc isNamedTuple(T: typedesc): bool {.magic: "TypeTrait".}
type
Joptions* = object # xxx rename FromJsonOptions