https://kotlinlang.org logo
#announcements
Title
# announcements
r

rook

07/23/2019, 5:40 PM
It seems like there’s a problem inferring type here. Am I doing something incorrectly?
s

Shawn

07/23/2019, 5:44 PM
var
makes smart-casting impossible in this case
try swapping your
when
out for this one
Copy code
when(val contained = bindee.containee) {
            is Foo -> bind(contained)
            is Bar -> bind(contained)
        }
💯 2
r

rook

07/23/2019, 6:31 PM
Thanks so much! I should have seen that was the issue
👍 1
Strangely, compilation succeeds, but my IDE says that
None of the following functions can be called with the arguments supplied
s

Shawn

07/23/2019, 6:35 PM
🤨
bizarre
r

rook

07/23/2019, 7:05 PM
I’m not sure if it’s a lint issue or what
m

Marat Akhin

07/24/2019, 12:02 PM
It may be because of the new inference engine, which is atm enabled in the IDE, but disabled in the compiler That may warrant creating a new issue in YT
1
r
2 Views