Skip to content

Regression in inferred return type for join on simple iterator. #55389

@KristofferC

Description

@KristofferC
Member
julia> itr = ("foo" for _ in 1:100)
Base.Generator{UnitRange{Int64}, var"#1#2"}(var"#1#2"(), 1:100)

julia> @code_warntype join(itr)
MethodInstance for join(::Base.Generator{UnitRange{Int64}, var"#1#2"})
  from join(iterator) @ Base strings/io.jl:374
Arguments
  #self#::Core.Const(join)
  iterator::Base.Generator{UnitRange{Int64}, var"#1#2"}
Body::Union{Base.AnnotatedString{String}, String}

This used to infer to String.

Ref #54919.

Activity

simeonschaub

simeonschaub commented on Aug 6, 2024

@simeonschaub
Member

Possible duplicate of #55279?

KristofferC

KristofferC commented on Aug 6, 2024

@KristofferC
MemberAuthor

I don't think so because in #55279, the issue is that seekstart itself is all of a sudden much slower.

julia> io = IOBuffer()

julia> @btime seekstart($io)
# master  
85.537 ns (0 allocations: 0 bytes)

# 1.11
 3.125 ns (0 allocations: 0 bytes)

As I wrote in #55279 (comment), I think there is some "inference poisoning" going on.

added 2 commits that reference this issue on Aug 6, 2024
ac7dab0
f86cfb8
added a commit that references this issue on Aug 6, 2024
09e5c40
added a commit that references this issue on Aug 8, 2024
fbcb434
added a commit that references this issue on Aug 17, 2024
5c6ffe4
added a commit that references this issue on Aug 26, 2024
0e42398
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @KristofferC@simeonschaub

        Issue actions

          Regression in inferred return type for `join` on simple iterator. · Issue #55389 · JuliaLang/julia