add typetraits.elementType (#14780)

* add typetraits.elementType

* add a test for 0-sized seq
This commit is contained in:
Timothee Cour 2020-06-24 13:31:07 -07:00 • committed by GitHub
commit 3e5743d6f7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 33 additions and 0 deletions

View file

@ -114,6 +114,7 @@
- Add `os.normalizeExe`, eg: `koch` => `./koch`.
- `macros.newLit` now preserves named vs unnamed tuples; use `-d:nimHasWorkaround14720` to keep old behavior
- Add `random.gauss`, that uses the ratio of uniforms method of sampling from a Gaussian distribution.
- Add `typetraits.elementType` to get element type of an iterable.
## Language changes
- In the newruntime it is now allowed to assign to the discriminator field