[FIR]: add missed bindings for WrappedReceiverParameterDescriptor.

This commit is contained in:
Juan Chen
2020-01-03 09:39:14 -08:00
committed by Mikhail Glukhikh
parent ea267d9ef4
commit d3b21aed8a
5 changed files with 12 additions and 8 deletions
@@ -111,14 +111,18 @@ class Fir2IrDeclarationStorage(
val thisOrigin = IrDeclarationOrigin.INSTANCE_RECEIVER
val thisType = IrSimpleTypeImpl(symbol, false, emptyList(), emptyList())
val parent = this
val receiverDescriptor = WrappedReceiverParameterDescriptor()
thisReceiver = irSymbolTable.declareValueParameter(
startOffset, endOffset, thisOrigin, WrappedReceiverParameterDescriptor(), thisType
startOffset, endOffset, thisOrigin, receiverDescriptor, thisType
) { symbol ->
IrValueParameterImpl(
startOffset, endOffset, thisOrigin, symbol,
Name.special("<this>"), -1, thisType,
varargElementType = null, isCrossinline = false, isNoinline = false
).apply { this.parent = parent }
).apply {
this.parent = parent
receiverDescriptor.bind(this)
}
}
leaveScope(descriptor)
}
@@ -351,15 +355,19 @@ class Fir2IrDeclarationStorage(
}
if (containingClass != null && !isStatic) {
val thisType = containingClass.thisReceiver!!.type
val descriptor = WrappedReceiverParameterDescriptor()
dispatchReceiverParameter = irSymbolTable.declareValueParameter(
startOffset, endOffset, thisOrigin, WrappedReceiverParameterDescriptor(),
startOffset, endOffset, thisOrigin, descriptor,
thisType
) { symbol ->
IrValueParameterImpl(
startOffset, endOffset, thisOrigin, symbol,
Name.special("<this>"), -1, thisType,
varargElementType = null, isCrossinline = false, isNoinline = false
).apply { this.parent = parent }
).apply {
this.parent = parent
descriptor.bind(this)
}
}
}
}
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
class MyRange1() : ClosedRange<Int> {
override val start: Int
get() = 0
@@ -1,5 +1,4 @@
// !LANGUAGE: +FunctionTypesWithBigArity
// IGNORE_BACKEND_FIR: JVM_IR
// WITH_RUNTIME
// TARGET_BACKEND: JVM
// FILE: J.java
@@ -1,5 +1,4 @@
// !LANGUAGE: +FunctionTypesWithBigArity
// IGNORE_BACKEND_FIR: JVM_IR
// Implementing function interface is prohibited in JavaScript
// IGNORE_BACKEND: JS_IR, JS
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
interface B<T> {
fun foo(dd: T): T = dd
}