move since from inclrtl to std/private/since (#14188)

* move since from inclrtl to std/private/since
* move since import in system below for HCR
This commit is contained in:
hlaaftana 2020-05-03 00:51:59 +03:00 • committed by GitHub
commit fbc97e712a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
27 changed files with 60 additions and 59 deletions

View file

@ -12,10 +12,9 @@
##
## Unstable API.
import std/private/since
export system.`$` # for backward compatibility
include "system/inclrtl"
proc name*(t: typedesc): string {.magic: "TypeTrait".}
## Returns the name of the given type.
##
@ -79,15 +78,13 @@ since (1, 1):
doAssert 12.MyInt.distinctBase == 12
distinctBase(type(a))(a)
proc tupleLen*(T: typedesc[tuple]): int {.magic: "TypeTrait", since: (1, 1).}
## Return number of elements of `T`
proc tupleLen*(T: typedesc[tuple]): int {.magic: "TypeTrait".}
## Return number of elements of `T`
since (1, 1):
template tupleLen*(t: tuple): int =
## Return number of elements of `t`
tupleLen(type(t))
since (1, 1):
template get*(T: typedesc[tuple], i: static int): untyped =
## Return `i`\th element of `T`
# Note: `[]` currently gives: `Error: no generic parameters allowed for ...`