Hi everyone 🙂 Does anyone know why in intellij IDEA there is no autocomplete for
readText
even after the cast in the line above?
Copy code
for (frame in incoming) {
frame as? Frame.Text ?: continue
val receivedText = frame.readText() // No autocomplete here
send("You said: $receivedText")
}
I'm going through the KTOR creating web socket chat tutorial and thought it was broken because it didn't give autocomplete for
readText
. It would only give
readBytes
for a general
Frame
.
Joshua Hannaford
07/19/2023, 3:25 PM
Interestingly, it seems like it only happens when I don't bind the result to a variable. The following code works just fine and gives autocompletion as expected.
Copy code
for (frame in incoming) {
val f = frame as? Frame.Text ?: continue
val receivedText = f.readText()
send("You said: $receivedText")
}