Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SET_TYPEOF() cannot convert REAL to INTEGER in merge #419

Closed
joshuaulrich opened this issue May 28, 2024 · 0 comments
Closed

SET_TYPEOF() cannot convert REAL to INTEGER in merge #419

joshuaulrich opened this issue May 28, 2024 · 0 comments
Assignees
Labels
Milestone

Comments

@joshuaulrich
Copy link
Owner

Description

This test fails in R-devel r86639:

x <- .xts(integer(), integer(), tclass = "Date", tzone = "UTC")
merge(x, x, x)
## Error in merge.xts(x, x, x) : can't change type from REALSXP to INTSXP
## Calls: merge -> merge.xts

Because of the call to SET_TYPEOF() here:

xts/src/merge.c

Line 375 in 5429845

SET_TYPEOF(out, TYPEOF(x));

That code block calls xts(), which returns an empty xts object with 'double' coredata. SET_TYPEOF() tries to convert it to the same type as x (integer) and that fails.

Thanks to Kurt Hornik for the report.

@joshuaulrich joshuaulrich self-assigned this May 28, 2024
@joshuaulrich joshuaulrich added this to the Next release milestone Jun 3, 2024
joshuaulrich added a commit that referenced this issue Jul 13, 2024
SET_TYPEOF() is not part of the public API and may be changed or
removed.

See #419.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant