Skip to content

AnnotatedString doesn't have an IOBuffer method #112

@MasonProtter

Description

@MasonProtter

This caused some unexpected errors in timholy/ProgressMeter.jl#343 (comment). The way you're supposed to find the number of lines in a string is with countlines(IOBuffer(str)) and this errors:

julia> str = Base.AnnotatedString(" julia", [(2:6, :face, :magenta)])
" julia"

julia> countlines(IOBuffer(str))
ERROR: MethodError: no method matching IOBuffer(::Base.AnnotatedString{String})
The type `IOBuffer` exists, but no method is defined for this combination of argument types when trying to construct it.

Closest candidates are:
  IOBuffer(::SubString{String})
   @ Base strings/io.jl:309
  IOBuffer(::String)
   @ Base strings/io.jl:308
  IOBuffer(; read, write, append, truncate, maxsize, sizehint)
   @ Base iobuffer.jl:119
  ...

Stacktrace:
 [1] top-level scope
   @ REPL[14]:1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy