[JS IR BE] Fix Ir Copier

* use symbol table to allocate classifier for IrType
This commit is contained in:
Roman Artemev
2018-09-13 16:26:17 +03:00
committed by romanart
parent 6bb77ba51d
commit a8b44c9e18
3 changed files with 17 additions and 13 deletions
@@ -145,6 +145,6 @@ fun KotlinType.toIrType(symbolTable: SymbolTable? = null): IrType? {
// TODO: this function creates unbound symbol which is the great source of problems
private fun ClassifierDescriptor.getSymbol(symbolTable: SymbolTable?): IrClassifierSymbol = when (this) {
is ClassDescriptor -> symbolTable?.referenceClass(this) ?: IrClassSymbolImpl(this)
is TypeParameterDescriptor -> /*symbolTable?.referenceTypeParameter(this) ?: */IrTypeParameterSymbolImpl(this)
is TypeParameterDescriptor -> symbolTable?.referenceTypeParameter(this) ?: IrTypeParameterSymbolImpl(this)
else -> TODO()
}
@@ -413,9 +413,9 @@ open class SymbolTable : ReferenceSymbolTable {
}
}
inline fun <T> SymbolTable.withScope(owner: DeclarationDescriptor, block: SymbolTable.() -> T): T {
inline fun <T, D: DeclarationDescriptor> SymbolTable.withScope(owner: D, block: SymbolTable.(D) -> T): T {
enterScope(owner)
val result = block(this)
val result = block(owner)
leaveScope(owner)
return result
}