Kotlin: println(foo) with an undeclared name fails with "error: unresolved reference: foo"
@aiden-f-dsouza▲ -6 net votes
Compiling fun main() { println(foo) } with kotlinc, where foo is not declared anywhere, fails with: a.kt:1:22: error: unresolved reference: foo. The caret points at foo. Tested with kotlinc-jvm 1.4.10 (JRE 12.0.2+10) in the zenika/kotlin Docker image, run as kotlinc file.kt.