[JS IR BE] Fix Ir Copier
* use symbol table to allocate classifier for IrType
This commit is contained in:
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user