CFG: provide "used as expression" in enum constant constructor
This allows to avoid "unused return value of a function with lambda expression body" for such a situation So #KT-20429 Fixed
This commit is contained in:
committed by
Mikhail Glukhikh
parent
e10fa218f5
commit
a65304556c
@@ -1447,6 +1447,14 @@ class ControlFlowProcessor(private val trace: BindingTrace) {
|
||||
generateCallOrMarkUnresolved(call)
|
||||
}
|
||||
|
||||
override fun visitInitializerList(list: KtInitializerList) {
|
||||
list.initializers
|
||||
.filterIsInstance<KtSuperTypeCallEntry>()
|
||||
.forEach {
|
||||
generateCallOrMarkUnresolved(it)
|
||||
}
|
||||
}
|
||||
|
||||
private fun generateCallOrMarkUnresolved(call: KtCallElement) {
|
||||
if (!generateCall(call)) {
|
||||
val arguments = call.valueArguments.mapNotNull(ValueArgument::getArgumentExpression)
|
||||
|
||||
Reference in New Issue
Block a user