[FIR] Fix equality for cfg nodes
This commit is contained in:
+1
-1
@@ -102,7 +102,7 @@ sealed class CFGNode<out E : FirElement>(val owner: ControlFlowGraph, val level:
|
|||||||
|
|
||||||
final override fun equals(other: Any?): Boolean {
|
final override fun equals(other: Any?): Boolean {
|
||||||
if (other !is CFGNode<*>) return false
|
if (other !is CFGNode<*>) return false
|
||||||
return this.id == other.id
|
return this === other
|
||||||
}
|
}
|
||||||
|
|
||||||
final override fun hashCode(): Int {
|
final override fun hashCode(): Int {
|
||||||
|
|||||||
+2
-1
@@ -15,6 +15,7 @@ import org.jetbrains.kotlin.fir.resolve.transformers.body.resolve.resultType
|
|||||||
import org.jetbrains.kotlin.fir.symbols.impl.FirCallableSymbol
|
import org.jetbrains.kotlin.fir.symbols.impl.FirCallableSymbol
|
||||||
import org.jetbrains.kotlin.fir.symbols.impl.FirFunctionSymbol
|
import org.jetbrains.kotlin.fir.symbols.impl.FirFunctionSymbol
|
||||||
import org.jetbrains.kotlin.fir.types.isNothing
|
import org.jetbrains.kotlin.fir.types.isNothing
|
||||||
|
import kotlin.random.Random
|
||||||
|
|
||||||
class ControlFlowGraphBuilder {
|
class ControlFlowGraphBuilder {
|
||||||
private val graphs: Stack<ControlFlowGraph> = stackOf(ControlFlowGraph(null, "<TOP_LEVEL_GRAPH>", ControlFlowGraph.Kind.TopLevel))
|
private val graphs: Stack<ControlFlowGraph> = stackOf(ControlFlowGraph(null, "<TOP_LEVEL_GRAPH>", ControlFlowGraph.Kind.TopLevel))
|
||||||
@@ -60,7 +61,7 @@ class ControlFlowGraphBuilder {
|
|||||||
var levelCounter: Int = 0
|
var levelCounter: Int = 0
|
||||||
private set
|
private set
|
||||||
|
|
||||||
private var idCounter: Int = 0
|
private var idCounter: Int = Random.nextInt()
|
||||||
private val shouldPassFlowFromInplaceLambda: Stack<Boolean> = stackOf(true)
|
private val shouldPassFlowFromInplaceLambda: Stack<Boolean> = stackOf(true)
|
||||||
|
|
||||||
fun createId(): Int = idCounter++
|
fun createId(): Int = idCounter++
|
||||||
|
|||||||
Reference in New Issue
Block a user