Drop unused members from DescriptorStorageForContextReceivers
This commit is contained in:
+1
-10
@@ -5,25 +5,16 @@
|
||||
|
||||
package org.jetbrains.kotlin.psi2ir.generators
|
||||
|
||||
import org.jetbrains.kotlin.descriptors.VariableDescriptor
|
||||
import org.jetbrains.kotlin.ir.declarations.IrField
|
||||
import org.jetbrains.kotlin.psi.KtExpression
|
||||
import org.jetbrains.kotlin.resolve.scopes.receivers.ReceiverValue
|
||||
|
||||
class DescriptorStorageForContextReceivers {
|
||||
private val variableStorage: MutableMap<KtExpression, VariableDescriptor> = mutableMapOf()
|
||||
private val syntheticFieldStorage: MutableMap<ReceiverValue, IrField> = mutableMapOf()
|
||||
|
||||
fun put(expression: KtExpression, descriptor: VariableDescriptor) {
|
||||
variableStorage[expression] = descriptor
|
||||
}
|
||||
|
||||
fun put(receiverValue: ReceiverValue, irField: IrField) {
|
||||
syntheticFieldStorage[receiverValue] = irField
|
||||
}
|
||||
|
||||
fun getVariable(expression: KtExpression) = variableStorage[expression] ?: error("No variable descriptor for receiver $expression")
|
||||
|
||||
fun getSyntheticField(receiverValue: ReceiverValue) =
|
||||
syntheticFieldStorage[receiverValue] ?: error("No synthetic field for receiver value $receiverValue")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user