From 8241499a36a327f0edf36f3d10fdd56e48e6932d Mon Sep 17 00:00:00 2001 From: jinbeom hong Date: Mon, 21 Aug 2017 06:07:25 +0900 Subject: [PATCH] Fix opearator as --- Chapter02/src/main/kotlin/com/packt/chapter2/smartcasts.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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