oracle / fastr

A high-performance implementation of the R programming language, built on GraalVM.
Other
623 stars 64 forks source link

dimnames behavior different after dim is changed #34

Closed comicfans closed 5 years ago

comicfans commented 5 years ago
  1. ary <- array(NA,dim=c(2,3,4),dimnames=list(1:2,1:3,1:4))
  2. dim(ary) <- c(6,4)
  3. dimnames(ary)[[2]] <- 1:4

fastR reports: length of 'dimnames' [3] must match that of 'dims' [2]

after step 2 dimnames(ary) gives NULL on GNUR, but fastR gives [[1]] [1] "1" "2"

[[2]] [1] "1" "2" "3"

[[3]] [1] "1" "2" "3" "4"

seems that fastR still preserve old dimnames even array dim is changed

steve-s commented 5 years ago

Hi comicfans,

thank you for the report and small reproducible example. We're working on the fix in FastR.

steve-s commented 5 years ago

Should be fixed in a03bc4284850f5cadba9a5cba69add9f024f23b8