Unwrap nested typealiases in code gen (#996)

* Add further nested typealias

* Recursively unwrap classnames

The unwrapped alias could be to something other than a classname!
This commit is contained in:
Zac Sweers
2019-11-02 09:43:08 -04:00
committed by GitHub
parent 541b53964c
commit c8c7121e76
2 changed files with 12 additions and 11 deletions

View File

@@ -322,7 +322,7 @@ private fun String.escapeDollarSigns(): String {
private fun TypeName.unwrapTypeAlias(): TypeName {
return when (this) {
is ClassName -> {
tag<TypeNameAliasTag>()?.type ?: this
tag<TypeNameAliasTag>()?.type?.unwrapTypeAlias() ?: this
}
is ParameterizedTypeName -> {
return (rawType.unwrapTypeAlias() as ClassName).parameterizedBy(typeArguments.map { it.unwrapTypeAlias() })