mirror of
https://github.com/fankes/moshi.git
synced 2025-10-19 16:09:21 +08:00
Always emit full types
Effectively reverts https://github.com/square/moshi/pull/1041
This commit is contained in:
@@ -18,7 +18,6 @@ package com.squareup.moshi.kotlin.codegen.api
|
||||
import com.squareup.kotlinpoet.ARRAY
|
||||
import com.squareup.kotlinpoet.AnnotationSpec
|
||||
import com.squareup.kotlinpoet.CodeBlock
|
||||
import com.squareup.kotlinpoet.CodeBlock.Companion
|
||||
import com.squareup.kotlinpoet.FileSpec
|
||||
import com.squareup.kotlinpoet.FunSpec
|
||||
import com.squareup.kotlinpoet.INT
|
||||
@@ -478,8 +477,10 @@ internal class AdapterGenerator(
|
||||
localConstructorProperty
|
||||
)
|
||||
} else {
|
||||
// Standard constructor call. Can omit generics as they're inferred
|
||||
result.addCode("«%L%T(", returnOrResultAssignment, originalTypeName.rawType())
|
||||
// Standard constructor call. Don't omit generics for parameterized types even if they can be
|
||||
// inferred, as calculating the right condition for inference exceeds the value gained from
|
||||
// being less pedantic.
|
||||
result.addCode("«%L%T(", returnOrResultAssignment, originalTypeName)
|
||||
}
|
||||
|
||||
for (input in components.filterIsInstance<ParameterComponent>()) {
|
||||
|
Reference in New Issue
Block a user