Merge pull request #523 from hzsweers/z/nonNullTypeVariabels

Fix nullable properties of TypeVariable types
This commit is contained in:
Jesse Wilson
2018-05-06 21:10:38 -04:00
committed by GitHub
3 changed files with 8 additions and 4 deletions

View File

@@ -40,7 +40,7 @@ internal data class DelegateKey(
private val type: TypeName,
private val jsonQualifiers: Set<AnnotationMirror>
) {
val nullable get() = type.nullable || type is TypeVariableName
val nullable get() = type.nullable
/** Returns an adapter to use when encoding and decoding this property. */
fun generateProperty(

View File

@@ -80,6 +80,7 @@ internal fun Type.asTypeName(
val realType = when {
hasTypeParameter() -> return getTypeParameter(typeParameter)
.asTypeName(nameResolver, getTypeParameter, resolveAliases)
.let { if (nullable) it.asNullable() else it }
hasTypeParameterName() -> typeParameterName
hasAbbreviatedType() && !resolveAliases -> abbreviatedType.typeAliasName
else -> className