elect
03/01/2019, 1:05 PMinline infix fun <reified C>VkDevice.allocateCommandBuffers(allocateInfo: VkCommandBufferAllocateInfo): C =
when(C::class) {
Array<VkCommandBuffer>::class -> Array(count) { .. } as C
ArrayList<VkCommandBuffer>::class -> ArrayList<VkCommandBuffer>(count) as C // error
On the second line the compiler complains:
Only classes are allowed on the left hand side of a class literal