Skip to content

Fix forwarding of missing arguments#835

Open
LeonidasZhak wants to merge 1 commit into
futureverse:developfrom
LeonidasZhak:fix/forward-missing-arguments-756
Open

Fix forwarding of missing arguments#835
LeonidasZhak wants to merge 1 commit into
futureverse:developfrom
LeonidasZhak:fix/forward-missing-arguments-756

Conversation

@LeonidasZhak

Copy link
Copy Markdown

Summary

Allow truly missing function arguments to be forwarded inside future expressions.

Thanks to maintainers

Thanks for maintaining future and for considering this fix.

Issue or motivation

Closes #756. A function can normally pass an omitted argument to another function, but the same call failed while creating a future.

Root cause

Automatic global discovery identified the missing argument as a global and then tried to retrieve its value. A truly missing promise has no value to retrieve, so collection stopped before the future was launched.

Change

If automatic collection fails, inspect referenced bindings without forcing them. Truly missing arguments are represented as missing formals around the future expression before collection is retried. Arguments with defaults keep their existing value-forwarding behavior. The patch also adds backend coverage and a NEWS entry.

Tests

  • focused missing/defaulted-argument test on sequential, multicore, and multisession backends
  • adjacent globals tricky and NSE tests
  • R CMD build .
  • R CMD check --as-cran future_1.70.0-9014.tar.gz (85 test scripts passed; two NOTEs for the development version and the local HTML Tidy version)

Scope

This does not change scheduling, explicit globals inputs, or global discovery in the globals package. The fallback runs only after automatic global collection errors and only wraps bindings that are truly missing without defaults.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot forward missing values in futures

1 participant