FIR2IR: convert enums with non-primary default ctor correctly

see added test for example
This commit is contained in:
Ilya Chernikov
2022-08-17 15:37:16 +02:00
parent 22d6906b33
commit 4e4511bba2
13 changed files with 85 additions and 14 deletions
@@ -213,6 +213,9 @@ val IrClassSymbol.functions: Sequence<IrSimpleFunctionSymbol>
val IrClass.constructors: Sequence<IrConstructor>
get() = declarations.asSequence().filterIsInstance<IrConstructor>()
val IrClass.defaultConstructor: IrConstructor?
get() = constructors.firstOrNull { ctor -> ctor.valueParameters.all { it.defaultValue != null } }
val IrClassSymbol.constructors: Sequence<IrConstructorSymbol>
get() = owner.constructors.map { it.symbol }