Skip to content

suboptimal inference for nextind, prevind on AbstractString #57605

Closed
@nsajko

Description

@nsajko

The nextind and prevind doc strings specify the return type as Int for any AbstractString, but inference doesn't know that even in a fresh REPL session:

julia> Base.infer_return_type(prevind, Tuple{AbstractString, Vararg})
Any

julia> Base.infer_return_type(nextind, Tuple{AbstractString, Vararg})
Any

Probably we could add a type assertion or two.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions