-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Issue
I have a function with the following Swift code:
var allProducts: [FNCProduct] = []
try await withThrowingTaskGroup(of: [FNCProduct].self) { pageProductsTaskGroup in
// Some irrelevant code
for try await pageProducts in pageProductsTaskGroup {
allProducts.append(contentsOf: pageProducts)
}
}
return allProductsThis gets transpiled to the following Kotlin code:
var allProducts: Array<FNCProduct> = arrayOf()
withThrowingTaskGroup(of = Array::class) { pageProductsTaskGroup ->
// Some irrelevant code
for (pageProducts in pageProductsTaskGroup.sref()) {
allProducts.append(contentsOf = pageProducts)
}
}
return@l allProducts.sref()I'm getting an error from the compiler that refers to the following line:
allProducts.append(contentsOf = pageProducts)
Argument type mismatch: actual type is 'skip.lib.Array<CapturedType(*)>', but 'skip.lib.Sequence<funico.module.FNCProduct>' was expected.
Proposed solution:
I think this:
withThrowingTaskGroup(of = Array::class)needs to change to this:
withThrowingTaskGroup(of = Array<FNCProduct>::class)Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working