maxmello
04/24/2023, 12:59 PMcontext(Transaction)
suspend inline fun <reified R: ResourceDTO, reified M : ResourceModel<R>>
PipelineContext<*, ApplicationCall>.restoreOneDeletedResource(
dao: ResourceDAOWithHistory<R, M>,
ignoreWarningsParameter: String,
changeLogParameter: String,
historyIdParameterName: String
): CreateUpdateResult<R> { ... }
Error (I think the relevant part of the very long error message)
Caused by: java.lang.IllegalArgumentException: No argument for parameter VALUE_PARAMETER name:historyIdParameterName index:4 type:kotlin.String:
When I move the Transaction context to the function parameters and use with(transaction) inside the function, it works.
Interestingly enough, the following related function gives no errors:
context(Transaction)
suspend inline fun <reified R: ResourceDTO, reified M : ResourceModel<R>>
PipelineContext<*, ApplicationCall>.createResource(dao: ResourceDAO<R, M>,
ignoreWarningsParameter: String,
changeLogParameter: String
): CreateUpdateResult<R> {
I would assume this is just a bug related to the fact context receivers are not stable and I am using every possible way to annoy the compiler (suspend, inline etc.)?mcpiroman
04/25/2023, 8:43 AMI would assume this is just a bug related to the fact context receivers are not stable and I am using every possible way to annoy the compiler (suspend, inline etc.)?Yes. Context receivers have a lot of bugs when combined with other language features.
maxmello
04/25/2023, 8:51 AM