mirror of
https://github.com/fankes/moshi.git
synced 2025-10-19 16:09:21 +08:00
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:
@@ -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() })
|
||||
|
Reference in New Issue
Block a user