[FIR] Disable data flow from in-place lambdas

There are many complications with the current design of passing data
from within in-place lambdas to surrounding code. Solving these
complications will involve more time to investigation than is available
within the K2 release. So we are disabling passing type statement
information from lambdas for the time being until more time can be
devoted to a more complete solution.

^KT-60958 Fixed
^KT-63530 Fixed
This commit is contained in:
Brian Norman
2023-12-11 10:25:48 -06:00
committed by Space Team
parent 645970fa7a
commit b2041e0927
68 changed files with 2834 additions and 2962 deletions
@@ -21,7 +21,15 @@ abstract class LogicSystem(private val context: ConeInferenceContext) {
return !isNullableNothing
}
fun joinFlow(flows: Collection<PersistentFlow>, union: Boolean): MutableFlow {
/**
* Creates the next [Flow] by joining a set of previous [Flow]s.
*
* @param flows All [PersistentFlow]s which flow into the join flow. These will determine assignments and variable aliases for the
* resulting join flow.
* @param statementFlows A *subset* of [flows] used to determine what [TypeStatement]s will be copied to the join flow.
* @param union Determines if [TypeStatement]s from different flows should be combined with union or intersection logic.
*/
fun joinFlow(flows: Collection<PersistentFlow>, statementFlows: Collection<PersistentFlow>, union: Boolean): MutableFlow {
when (flows.size) {
0 -> return MutableFlow()
1 -> return flows.first().fork()
@@ -37,7 +45,7 @@ abstract class LogicSystem(private val context: ConeInferenceContext) {
} else {
result.copyCommonAliases(flows)
}
result.copyStatements(flows, commonFlow, union)
result.copyStatements(statementFlows, commonFlow, union)
// TODO: compute common implications?
return result
}
@@ -106,6 +106,10 @@ object UncaughtExceptionPath : EdgeLabel {
override val label: String get() = "onUncaughtException"
}
object PostponedPath : EdgeLabel {
override val label: String get() = "Postponed"
}
enum class EdgeKind(
val usedInDfa: Boolean, // propagate flow to alive nodes
val usedInDeadDfa: Boolean, // propagate flow to dead nodes