Add additional check to IrClass.findEnumValuesMethod()
to avoid finding user-defined member function
This commit is contained in:
+1
-1
@@ -117,7 +117,7 @@ fun IrClass.serialName(): String {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun IrClass.findEnumValuesMethod() = this.functions.singleOrNull { f ->
|
fun IrClass.findEnumValuesMethod() = this.functions.singleOrNull { f ->
|
||||||
f.name == Name.identifier("values") && f.valueParameters.isEmpty() && f.extensionReceiverParameter == null
|
f.name == Name.identifier("values") && f.valueParameters.isEmpty() && f.extensionReceiverParameter == null && f.dispatchReceiverParameter == null
|
||||||
} ?: throw AssertionError("Enum class does not have single .values() function")
|
} ?: throw AssertionError("Enum class does not have single .values() function")
|
||||||
|
|
||||||
internal fun IrClass.enumEntries(): List<IrEnumEntry> {
|
internal fun IrClass.enumEntries(): List<IrEnumEntry> {
|
||||||
|
|||||||
Reference in New Issue
Block a user