I’ve got a sort of odd case here where I have a fu...
# eap
z
I’ve got a sort of odd case here where I have a function that returns
Single<Collection<Type>>
and internally code that looks like this
Copy code
return someListSingle.map { list -> list as Collection<Type> }
In 1.8.0-RC, this cast is marked as redundant (as a compilation warning), but removing it actually causes a compilation error. I’m not sure if it’s expected to automatically infer the cast or if I should report a bug for a false-positive warning.
I see it with upcasting of any sort too, not just collections/generic types
i
Can you attach a link to the code? Looks similar to https://youtrack.jetbrains.com/issue/KT-54027
z
looks the same but this passes with 1.7.22. Let me try to put together a simpler repro
Filed an issue with repros for all three issues (the above + two I described in this thread accidentally) CC @mglukhikh @udalov https://youtrack.jetbrains.com/issue/KT-55535/Type-inference-regressions-in-1.8.0-RC
m
🙏