Fix nullable properties of TypeVariable types

We were forgetting to apply the property's nullability to the resolved type.

Fixes #521
This commit is contained in:
Zac Sweers
2018-05-04 12:11:41 -07:00
parent 10a5dc827b
commit 54aca07ca1
3 changed files with 8 additions and 4 deletions

View File

@@ -222,14 +222,16 @@ class GeneratedAdaptersTest {
listOf("foo", null, "bar"),
setOf("foo", null, "bar"),
mapOf("foo" to "bar", "baz" to null),
null
null,
1
)
val noNullsTypeParams = NullableTypeParams<Int>(
nullableTypeParams.nullableList,
nullableTypeParams.nullableSet,
nullableTypeParams.nullableMap.filterValues { it != null },
null
null,
1
)
val json = adapter.toJson(nullableTypeParams)
@@ -782,7 +784,8 @@ data class NullableTypeParams<T>(
val nullableList: List<String?>,
val nullableSet: Set<String?>,
val nullableMap: Map<String, String?>,
val nullableT: T?
val nullableT: T?,
val nonNullT: T
)
typealias TypeAliasName = String