[FIR] Add optin on API of updating type of receiver values. KT-54708

This commit is contained in:
Dmitriy Novozhilov
2022-10-28 14:23:20 +03:00
committed by Space Team
parent e6ce008415
commit 7af43176ce
6 changed files with 18 additions and 4 deletions
@@ -100,9 +100,10 @@ class PersistentImplicitReceiverStack private constructor(
// This method is only used from DFA and it's in some sense breaks persistence contracts of the data structure
// But it's ok since DFA handles everything properly yet, but still may be it should be rewritten somehow
@OptIn(ImplicitReceiverValue.ImplicitReceiverInternals::class)
fun replaceReceiverType(index: Int, type: ConeKotlinType) {
assert(index >= 0 && index < stack.size)
stack[index].replaceType(type)
stack[index].updateTypeFromSmartcast(type)
}
fun createSnapshot(): PersistentImplicitReceiverStack {