File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed
Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change 1919- Added ` jssets ` module, Set for the JavaScript target
2020 https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set
2121- Added ` jsheaders ` module for [ ` Headers ` ] ( https://developer.mozilla.org/en-US/docs/Web/API/Headers ) for the JavaScript target.
22+ - Added module ` pointers ` containing ` toUncheckedArray ` , UFCS/MCS ` cast `
Original file line number Diff line number Diff line change @@ -15,3 +15,11 @@ proc toUncheckedArray*[T](a: ptr T): ptr UncheckedArray[T] {.inline.} =
1515 pa[0 ] += 5
1616 doAssert a[1 ] == 105
1717 cast [ptr UncheckedArray [T]](a)
18+
19+ proc `cast` * [T](a:T, T2: typedesc ): T2 =
20+ # # allows running `cast` in UFCS/method call syntax chains.
21+ # # Unsafe as it calls `cast`.
22+ runnableExamples:
23+ proc square (a: auto ): auto = a* a
24+ doAssert 3 .square.cast (float ).square == cast [float ](3 .square).square
25+ cast [T2 ](a)
You can’t perform that action at this time.
0 commit comments