From 399c9f0abc2060ff0fb952e2df41b0cacd63166e Mon Sep 17 00:00:00 2001 From: Vladimir Shefer Date: Mon, 28 Sep 2020 13:32:08 +0300 Subject: [PATCH] Fix compile error in DateFactory --- KotlinOutputFiles/DateFactory.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/KotlinOutputFiles/DateFactory.kt b/KotlinOutputFiles/DateFactory.kt index 64604fa..611026d 100644 --- a/KotlinOutputFiles/DateFactory.kt +++ b/KotlinOutputFiles/DateFactory.kt @@ -5,8 +5,8 @@ import java.lang.reflect.Type class DateFactory : JsonAdapter.Factory { override fun create(type: Type, annotations: Set, moshi: Moshi): JsonAdapter<*>? { - val typeName = when(type) { - is Class<*> -> type.canonicalName + val typeName: String = when(type) { + is Class<*> -> type.canonicalName ?: type.toString() else -> type.toString() }