rstudio / promises

A promise library for R
https://rstudio.github.io/promises
Other
198 stars 19 forks source link

`finally` causes `invisible()` to be dropped #18

Closed jcheng5 closed 3 years ago

jcheng5 commented 6 years ago

These three code chunks should have the same effect (should print FALSE, FALSE, FALSE) but they don't:

library(promises)

promise_resolve(invisible(1)) %>%
  then(function(x, .visible) {
    print(.visible)
  })

promise_resolve(invisible(1)) %>%
  catch(~{}) %>%
  then(function(x, .visible) {
    print(.visible)
  })

promise_resolve(invisible(1)) %>%
  finally(~{}) %>%
  then(function(x, .visible) {
    print(.visible)
  })
schloerke commented 3 years ago

Originally fixed in https://github.com/rstudio/promises/pull/43/files#diff-1b5f31c11060c74195592af96d6c7a2fbc65f23c35a22b7e70989c383b87d070R21-R30

Closing