Hey, tried out the snapshot, and just wanted to le...
# apollo-kotlin
s
Hey, tried out the snapshot, and just wanted to let you know, there is some code with compilation errors that gets generated: It’s such a silly reason, I would’ve totally expected this to work but I guess the way the code is parsed it doesn’t. So the problem is from the final return type being put after the
return
keyword, on the next line, showing it off as
Unreachable code
, and the return keyword with “This function must return a value of type Map<String, Any?>” Aka the code is parsed wrong, and this is one of the few cases where I guess it’d work if Kotlin had semicolons right 😂 In one of my test builders, this is generated:
Copy code
public
    fun additionalPaymentsDetailsResponseFinishedSubmitAdditionalPaymentDetails(block: AdditionalPaymentsDetailsResponseFinishedSubmitAdditionalPaymentDetailsBuilder.() -> Unit
    = {}): Map<String, Any?> {
  __shouldBeAssignedFields.add("submitAdditionalPaymentDetails")
  return
      AdditionalPaymentsDetailsResponseFinishedSubmitAdditionalPaymentDetailsBuilder().apply(block).build()
}
while what should’ve been generated and would work is this
Copy code
public
    fun additionalPaymentsDetailsResponseFinishedSubmitAdditionalPaymentDetails(block: AdditionalPaymentsDetailsResponseFinishedSubmitAdditionalPaymentDetailsBuilder.() -> Unit
    = {}): Map<String, Any?> {
  __shouldBeAssignedFields.add("submitAdditionalPaymentDetails")
  return AdditionalPaymentsDetailsResponseFinishedSubmitAdditionalPaymentDetailsBuilder().apply(block).build()
}