Skip to content

Commit

Permalink
add changelog, var test using nim-lang#24037
Browse files Browse the repository at this point in the history
  • Loading branch information
metagn committed Sep 3, 2024
1 parent 35b03ef commit 7c6839d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
- Added `setLenUninit` to system, which doesn't initialize
slots when enlarging a sequence.
- Added `hasDefaultValue` to `std/typetraits` to check if a type has a valid default value.
- Added `rangeBase` to `std/typetraits` to obtain the base type of a range type or
convert a value with a range type to its base type.
- Added Viewport API for the JavaScript targets in the `dom` module.
- Added `toSinglyLinkedRing` and `toDoublyLinkedRing` to `std/lists` to convert from `openArray`s.
- ORC: To be enabled via `nimOrcStats` there is a new API called `GC_orcStats` that can be used to query how many
Expand Down
8 changes: 8 additions & 0 deletions tests/metatype/ttypetraits.nim
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,14 @@ block: # rangeBase
doAssert foo(z) == "ranged(a..z of char) char(g)"
{.pop.}

# works only with #24037:
var toChange: range[0..3] = 1
proc bar[T: int and not range](y: var T) =
inc y
doAssert not compiles(bar(toChange))
bar(rangeBase(toChange))
doAssert toChange == 2

block: # tupleLen
doAssert not compiles(tupleLen(int))

Expand Down

0 comments on commit 7c6839d

Please sign in to comment.