Skip to main content
Journey Uncommon Logo
JourneyUncommon
easyKotlinsmart castsSingle-choice MCQ

Why does the second println below cause a compile error?

fun describe(x: Any) { if (x is String) { println(x.length) } println(x.length) }