diff --git a/src/main/kotlin/com/slack/auto/value/kotlin/AutoValueKotlinExtension.kt b/src/main/kotlin/com/slack/auto/value/kotlin/AutoValueKotlinExtension.kt index 9961bc7..75e94a8 100644 --- a/src/main/kotlin/com/slack/auto/value/kotlin/AutoValueKotlinExtension.kt +++ b/src/main/kotlin/com/slack/auto/value/kotlin/AutoValueKotlinExtension.kt @@ -449,17 +449,23 @@ private fun AvkBuilder.Companion.from( parseDocs: Element.() -> String? ): AvkBuilder { + // Merge the set of all properties with setters and builders + val allProperties = builderContext.setters().keys + builderContext.propertyBuilders().keys + // Setters val props = - builderContext.setters().entries.map { (prop, setters) -> + allProperties.map { prop -> + val setters = builderContext.setters()[prop] ?: emptyList() + val propertyBuilder = + builderContext.propertyBuilders()[prop]?.let { propertyBuilder -> + FunSpec.copyOf(propertyBuilder).withDocsFrom(propertyBuilder, parseDocs).build() + } val type = propertyTypes.getValue(prop) BuilderProperty( prop, type, setters.mapTo(LinkedHashSet()) { FunSpec.copyOf(it).withDocsFrom(it, parseDocs).build() }, - builderContext.propertyBuilders()[prop]?.let { propertyBuilder -> - FunSpec.copyOf(propertyBuilder).withDocsFrom(propertyBuilder, parseDocs).build() - } + propertyBuilder ) }