IntelliJ is giving me this warning. And I don't fully understand how to fix this. Could someone explain what I'm doing wrong by calling
.get
here?
jeggy
05/02/2020, 10:23 PM
Found it! Was because of me providing the wrong argument. This warning just confused me 😲
This was a real error made by me, I would not expect it to only show as a warning but rather be shown as an error.
i
ilya.gorbunov
05/03/2020, 4:01 AM
This raises a compilation error in Kotlin 1.3.7x. On the contrary, IDE shows this as a warning -- that's because it uses another new experimental type inference algorithm.
That algorithm will have been fixed to treat this situation as an error by the time it becomes the default type inference used by the compiler.
👍 2
n
nkiesel
05/04/2020, 6:43 PM
can you enlighten me what the actual error was?
j
jeggy
05/05/2020, 1:10 PM
in it's most basic form it was this. Here I've added 2 screenshots, one with the new type inference algorithm and one without.
jeggy
05/05/2020, 1:11 PM
the KEY type in this map isn't of the type Int which is why it's an error.
n
nkiesel
05/19/2020, 8:50 PM
I got that. What I missed was that the map key was