Restore enum class exclusion from constructor default parameters

This commit is contained in:
Chris Smowton
2022-11-02 11:28:13 +00:00
parent 4910bf12e9
commit 39520e54ea

View File

@@ -3065,7 +3065,7 @@ open class KotlinFileExtractor(
val valueArgs = (0 until e.valueArgumentsCount).map { e.getValueArgument(it) }
// For now, don't try to use default methods for enum constructor calls,
// which have null arguments even though the parameters don't give default values.
val id = if (callUsesDefaultArguments(e.symbol.owner, valueArgs)) {
val id = if (e !is IrEnumConstructorCall && callUsesDefaultArguments(e.symbol.owner, valueArgs)) {
extractNewExpr(getDefaultsMethodLabel(e.symbol.owner).cast(), type, locId, parent, idx, callable, enclosingStmt).also {
extractDefaultsCallArguments(it, e.symbol.owner, callable, enclosingStmt, valueArgs, null, null)
}