diff --git a/Chapter02/src/main/kotlin/com/packt/chapter2/smartcasts.kt b/Chapter02/src/main/kotlin/com/packt/chapter2/smartcasts.kt index 14ba00b..e107274 100644 --- a/Chapter02/src/main/kotlin/com/packt/chapter2/smartcasts.kt +++ b/Chapter02/src/main/kotlin/com/packt/chapter2/smartcasts.kt @@ -27,5 +27,5 @@ fun length(any: Any): Int { fun safeCast() { val any = "/home/users" val string: String? = any as String - val file: File? = any as File + val file: File? = any as? File } \ No newline at end of file