Got a bug report on KotlinPoet regarding the follo...
# announcements
e
Got a bug report on KotlinPoet regarding the following scenario:
Copy code
enum class RenderPassCreate(override val value: Int) {
    companion object
}
This is the code we currently generate, and it will not compile, with the error being
Expecting ';' after the last enum entry or '}' to close enum class body
. The compiler expects the following:
Copy code
enum class RenderPassCreate(override val value: Int) {
    ;
    companion object
}
which in my opinion looks ugly. I wonder if there’s a hard technical limitation behind this, and whether the compiler could handle this better? Tried searching YouTrack and it doesn’t look like it’s been filed
both are good points
d
In vulkan, some enums have no entries yet and are reserved for future use.
It's done so they don't have the situation where they have to make a
vkCreateRenderPass2(...)
method because
vkCreateRenderPass(...)
doesn't take a
RenderPassCreate
parameter. It's also consistent with all the other
vkCreateSomeObject
methods that take a
SomeObjectCreate
parameter that have actual entries.
Yeah, always pass null.