Skip to content

glimpse() may not dispatch properly to type_sum() #185

Closed
@dholstius

Description

@dholstius

Hi, thanks for all your work on tibble!

Here's an example of a simple problem. I'm about to try and submit a pull request.

CY <- function (x) {
  stopifnot(is.numeric(x))
  structure(as.integer(x), class = "CY")
}

as.character.CY <- function (from) {
  paste0(class(from), unclass(from))
}

library(tibble)

df <- tibble(cal_yr = CY(2011:2013), 
             budget = c(100, 200, 150))

type_sum.CY <- function (x, ...) {
  "CY"
}

glimpse(df)
lapply(df, class)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behaviorprinting 🖨️

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions