Kotlin - Variables and Type System
Identify the error in this Kotlin code snippet:
fun printLength(obj: Any) {
if (obj is String) {
println(obj.length())
}
}