Asignación no permitida en la expresión while?

En Java, generalmente podemos realizar una tarea dentro delwhile condición. Sin embargo, Kotlin se queja al respecto. Entonces el siguiente código no se compila:

val br = BufferedReader(InputStreamReader(
        conn.inputStream))

var output: String
println("Output from Server .... \n")
while ((output = br.readLine()) != null) { // <--- error here: Assignments are not expressions, and only expressions are allowed in this context
    println(output)
}

Según este otrohilo, esta parece la mejor solución:

val reader = BufferedReader(reader)
var line: String? = null;
while ({ line = reader.readLine(); line }() != null) { // <--- The IDE asks me to replace this line for while(true), what the...?
  System.out.println(line);
}

¿Pero es?

Respuestas a la pregunta(5)

Su respuesta a la pregunta