added system.default in order to prevent the abstraction inversion that 'template default(T): untyped = (var x: T; x)' causes
This commit is contained in:
parent
2dc8a32324
commit
142a2d3551
7 changed files with 50 additions and 11 deletions
|
|
@ -4278,6 +4278,10 @@ proc `$`*(t: typedesc): string {.magic: "TypeTrait".} =
|
|||
doAssert $(type("Foo")) == "string"
|
||||
static: doAssert $(type(@['A', 'B'])) == "seq[char]"
|
||||
|
||||
when defined(nimHasDefault):
|
||||
proc default*(T: typedesc): T {.magic: "Default", noSideEffect.}
|
||||
## returns the default value of the type ``T``.
|
||||
|
||||
import system/widestrs
|
||||
export widestrs
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue