Skip to content

Allow coercion for NA input to fifelse #4277

@MichaelChirico

Description

@MichaelChirico
fifelse(c(TRUE, FALSE), NA, 1L)
# Error in fifelse(c(TRUE, FALSE), NA, 1L) : 
#   'yes' is of type logical but 'no' is of type integer. Please make sure that both arguments have the same type.

that typeof(NA) is logical I think is an implementaton detail we can obscure from users. we should coerce NA to NA_integer_ in this case.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions