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:
parent
3be669be32
commit
fbc97e712a
27 changed files with 60 additions and 59 deletions
|
|
@ -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 ...`
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue