Add optional recursive arg to distinctBase (v2) (#18659)

* Add optional recursive arg to distinctBase
* Add docs and examples

Co-authored-by: ALANVF <alan.invents@gmail.com>
This commit is contained in:
Timothee Cour 2021-08-08 23:51:39 -07:00 • committed by GitHub
commit 8ce782d463
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 10 deletions

View file

@ -1,7 +1,7 @@
proc isNamedTuple(T: typedesc): bool {.magic: "TypeTrait".}
## imported from typetraits
proc distinctBase(T: typedesc): typedesc {.magic: "TypeTrait".}
proc distinctBase(T: typedesc, recursive: static bool = true): typedesc {.magic: "TypeTrait".}
## imported from typetraits
proc repr*(x: NimNode): string {.magic: "Repr", noSideEffect.}