[KAPT] Fix field type correction for delegates (#4107)

#KT-37586 Fixes
This commit is contained in:
Andrey Zinovyev
2021-02-14 10:38:38 +03:00
committed by GitHub
parent bf9fa4c9da
commit 4a0437a507
5 changed files with 77 additions and 4 deletions
@@ -0,0 +1,13 @@
// CORRECT_ERROR_TYPES
@file:Suppress("UNRESOLVED_REFERENCE")
package test
class Delegate {
operator fun getValue(thisRef: Any, property: KProperty<*>): Any {return Any()}
}
class Bar(delegate: Delegate) {
private val unknown: Unknown by delegate
}
@@ -0,0 +1,38 @@
package test;
import java.lang.System;
@kotlin.Metadata()
public final class Bar {
private final test.Delegate unknown$delegate = null;
public Bar(@org.jetbrains.annotations.NotNull()
test.Delegate delegate) {
super();
}
private final Unknown getUnknown() {
return null;
}
}
////////////////////
package test;
import java.lang.System;
@kotlin.Metadata()
public final class Delegate {
public Delegate() {
super();
}
@org.jetbrains.annotations.NotNull()
public final java.lang.Object getValue(@org.jetbrains.annotations.NotNull()
java.lang.Object thisRef, @org.jetbrains.annotations.NotNull()
KProperty<?> property) {
return null;
}
}