Skip to content

Return length-0 prototype for tfd(list())#299

Open
SAY-5 wants to merge 1 commit into
tidyfun:mainfrom
SAY-5:fix-tfd-empty-list-prototype
Open

Return length-0 prototype for tfd(list())#299
SAY-5 wants to merge 1 commit into
tidyfun:mainfrom
SAY-5:fix-tfd-empty-list-prototype

Conversation

@SAY-5

@SAY-5 SAY-5 commented Jul 18, 2026

Copy link
Copy Markdown

Fixes #296.

tfd(list()) was falling through to the per-entry processing in tfd.list(), which ended up calling assert_numeric(arg[[1]]) on an empty arg list and raising "subscript out of bounds". Now an empty data returns the same length-0 prototype that tfd(numeric(0)) already produces, and the two are identical().

Added a regression test in test-empty-prototypes.R.

Signed-off-by: Sai Asish Y <say.apm35@gmail.com>
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.

tfd(list()) errors "subscript out of bounds" instead of returning the length-0 prototype

1 participant