Arraymancer icon indicating copy to clipboard operation
Arraymancer copied to clipboard

Replace deprecated `dataArray` with `toUnsafeView`

Open asnt opened this issue 2 years ago • 3 comments

Following the hint.

asnt avatar Dec 30 '21 20:12 asnt

Tests fail with Nim 1.0.x.

asnt avatar Jan 03 '22 09:01 asnt

image

The issue can probably be solved by:

  • importing std/typetraits in tensor/initialization.nim
  • exporting std/typetraits in tensor/algorithms.nim
  • using mixin DistinctBase in toUnsafeView

https://github.com/mratsim/Arraymancer/runs/4669608372?check_suite_focus=true#step:23:390

This looks like another instance of the generic sandwich https://github.com/nim-lang/Nim/issues/11225

mratsim avatar Jan 03 '22 10:01 mratsim

@mratsim Thank you. I tried the suggestion without luck. Does distinctBase exist in nim 1.0.x?:

# test.nim
import std/typetraits
echo type(distinctBase)
# Not OK.
$ choosenim 1.0.10
$ nim c -r test.nim
[...]
/home/u/Arraymancer/test.nim(2, 11) Error: undeclared identifier: 'distinctBase'
# OK.
$ choosenim 1.2.16
$ nim c -r test.nim
[...]
None

asnt avatar Jan 04 '22 20:01 asnt

@mratsim I believe this PR can be closed after :

  • https://github.com/mratsim/Arraymancer/pull/570
  • https://github.com/mratsim/Arraymancer/pull/569

were merged

Clonkk avatar Sep 21 '22 08:09 Clonkk

Closing as unnecessary as mentioned by Clonkk. Thanks @asnt though and sorry for not getting it merged!

Vindaar avatar Nov 29 '22 11:11 Vindaar