[FIR] Fix dispatch receivers on inner classes' constructors

1. Inner class constructor should have its outer class as a dispatch
receiver, since it is necessary for the call. Before it was null
2. Substituted inner class constructor should have its original dispatch
 receiver type with the proper substitution. Before it was set to the
 class itself (since the class was usually passed as a new dispatch
 receiver)

Also, modify FIR renderer, so it properly renders the dispatch receiver
of the constructors
This commit is contained in:
Roman Golyshev
2021-09-28 16:40:18 +03:00
committed by Space
parent 8673819260
commit 9b9c51bc8d
65 changed files with 169 additions and 129 deletions
@@ -6,11 +6,11 @@ public/*package*/ open class AnnotatedParameterInInnerClassConstructor : R|kotli
}
public/*package*/ open inner class Inner : R|kotlin/Any| {
public/*package*/ constructor(@R|test/AnnotatedParameterInInnerClassConstructor.Anno|(value = String(a)) a: R|ft<kotlin/String, kotlin/String?>|, @R|test/AnnotatedParameterInInnerClassConstructor.Anno|(value = String(b)) b: R|ft<kotlin/String, kotlin/String?>|): R|test/AnnotatedParameterInInnerClassConstructor.Inner|
public/*package*/ test/AnnotatedParameterInInnerClassConstructor.constructor(@R|test/AnnotatedParameterInInnerClassConstructor.Anno|(value = String(a)) a: R|ft<kotlin/String, kotlin/String?>|, @R|test/AnnotatedParameterInInnerClassConstructor.Anno|(value = String(b)) b: R|ft<kotlin/String, kotlin/String?>|): R|test/AnnotatedParameterInInnerClassConstructor.Inner|
}
public/*package*/ open inner class InnerGeneric<T : R|ft<kotlin/Any, kotlin/Any?>|> : R|kotlin/Any| {
public/*package*/ constructor<T : R|ft<kotlin/Any, kotlin/Any?>|>(@R|test/AnnotatedParameterInInnerClassConstructor.Anno|(value = String(a)) a: R|ft<kotlin/String, kotlin/String?>|, @R|test/AnnotatedParameterInInnerClassConstructor.Anno|(value = String(b)) b: R|ft<kotlin/String, kotlin/String?>|): R|test/AnnotatedParameterInInnerClassConstructor.InnerGeneric<T>|
public/*package*/ test/AnnotatedParameterInInnerClassConstructor.constructor<T : R|ft<kotlin/Any, kotlin/Any?>|>(@R|test/AnnotatedParameterInInnerClassConstructor.Anno|(value = String(a)) a: R|ft<kotlin/String, kotlin/String?>|, @R|test/AnnotatedParameterInInnerClassConstructor.Anno|(value = String(b)) b: R|ft<kotlin/String, kotlin/String?>|): R|test/AnnotatedParameterInInnerClassConstructor.InnerGeneric<T>|
}
}
@@ -6,7 +6,7 @@ public open class AnnotationRetentions : R|kotlin/Any| {
}
@R|test/AnnotationRetentions.BaseAnnotation|() public/*package*/ open inner class BaseClass : R|kotlin/Any| {
public/*package*/ constructor(): R|test/AnnotationRetentions.BaseClass|
public/*package*/ test/AnnotationRetentions.constructor(): R|test/AnnotationRetentions.BaseClass|
}
@R|kotlin/annotation/Retention|(value = R|kotlin/annotation/AnnotationRetention.BINARY|()) public final annotation class BinaryAnnotation : R|kotlin/Annotation| {
@@ -14,7 +14,7 @@ public open class AnnotationRetentions : R|kotlin/Any| {
}
@R|test/AnnotationRetentions.BinaryAnnotation|() public/*package*/ open inner class BinaryClass : R|kotlin/Any| {
public/*package*/ constructor(): R|test/AnnotationRetentions.BinaryClass|
public/*package*/ test/AnnotationRetentions.constructor(): R|test/AnnotationRetentions.BinaryClass|
}
@R|kotlin/annotation/Retention|(value = R|kotlin/annotation/AnnotationRetention.RUNTIME|()) public final annotation class RuntimeAnnotation : R|kotlin/Annotation| {
@@ -22,7 +22,7 @@ public open class AnnotationRetentions : R|kotlin/Any| {
}
@R|test/AnnotationRetentions.RuntimeAnnotation|() public/*package*/ open inner class RuntimeClass : R|kotlin/Any| {
public/*package*/ constructor(): R|test/AnnotationRetentions.RuntimeClass|
public/*package*/ test/AnnotationRetentions.constructor(): R|test/AnnotationRetentions.RuntimeClass|
}
@R|kotlin/annotation/Retention|(value = R|kotlin/annotation/AnnotationRetention.SOURCE|()) public final annotation class SourceAnnotation : R|kotlin/Annotation| {
@@ -30,7 +30,7 @@ public open class AnnotationRetentions : R|kotlin/Any| {
}
@R|test/AnnotationRetentions.SourceAnnotation|() public/*package*/ open inner class SourceClass : R|kotlin/Any| {
public/*package*/ constructor(): R|test/AnnotationRetentions.SourceClass|
public/*package*/ test/AnnotationRetentions.constructor(): R|test/AnnotationRetentions.SourceClass|
}
}