Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

join((), ",") fails #26871

Closed
mbauman opened this issue Apr 20, 2018 · 1 comment
Closed

join((), ",") fails #26871

mbauman opened this issue Apr 20, 2018 · 1 comment
Labels
bug Indicates an unexpected problem or unintended behavior iteration Involves iteration or the iteration protocol

Comments

@mbauman
Copy link
Sponsor Member

mbauman commented Apr 20, 2018

julia> join((), ",")
ERROR: TypeError: in fieldtype, expected DataType, got Type{Union{}}
Stacktrace:
 [1] fixpoint_iter_type at ./iterators.jl:1081 [inlined]
 [2] Type at ./iterators.jl:1055 [inlined]
 [3] join at ./strings/io.jl:239 [inlined]
 [4] #sprint#354 at ./strings/io.jl:99 [inlined]
 [5] sprint at ./strings/io.jl:95 [inlined]
 [6] join(::Tuple{}, ::String) at ./strings/io.jl:248
 [7] top-level scope

The Iterators.Stateful iterator does not handle the case where next(v, s) is guaranteed to be an error and thus inference infers it as Union{}. This is the case for next((), start(())).

@mbauman mbauman added iteration Involves iteration or the iteration protocol bug Indicates an unexpected problem or unintended behavior labels Apr 20, 2018
mbauman added a commit that referenced this issue May 10, 2018
This is a simply hack to avoid working with an `Iterators.Stateful(())`, which has problems when trying to stably infer the return type of the error function `next((), _)`. Punts #26871 to just using `Stateful` itself.
JeffBezanson pushed a commit that referenced this issue May 14, 2018
This is a simply hack to avoid working with an `Iterators.Stateful(())`, which has problems when trying to stably infer the return type of the error function `next((), _)`. Punts #26871 to just using `Stateful` itself.
@KristofferC
Copy link
Sponsor Member

#27062

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior iteration Involves iteration or the iteration protocol
Projects
None yet
Development

No branches or pull requests

2 participants