Skip to content

Only use more specific convert methods#670

Open
hadley wants to merge 1 commit into
mainfrom
convert-dispatch
Open

Only use more specific convert methods#670
hadley wants to merge 1 commit into
mainfrom
convert-dispatch

Conversation

@hadley
Copy link
Copy Markdown
Member

@hadley hadley commented May 30, 2026

Fixes #429

@lawremi does this do what you expect?

@hadley hadley assigned lawremi and unassigned lawremi May 30, 2026
@hadley hadley requested a review from lawremi May 30, 2026 17:21
Copy link
Copy Markdown
Collaborator

@lawremi lawremi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this, much appreciated.

Comment thread R/convert.R
from_dispatch <- obj_dispatch(from)
to_class <- class_register(to)

for (i in seq_along(from_dispatch)) {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually is this correct? Shouldn't it only consider an exact match? (i.e. no inheritance at all?)

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.

convert() should be idempotent when from is an instance of to

2 participants