FIR: fix resolve of function type & its parameters in supertype position
This commit is contained in:
+5
-1
@@ -144,6 +144,10 @@ open class FirTypeResolveTransformer : FirTransformer<Nothing?>() {
|
|||||||
return resolvedType.compose()
|
return resolvedType.compose()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun transformValueParameter(valueParameter: FirValueParameter, data: Nothing?): CompositeTransformResult<FirDeclaration> {
|
||||||
|
return valueParameter.also { it.transformChildren(this, data) }.compose()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
override fun transformTypeProjectionWithVariance(
|
override fun transformTypeProjectionWithVariance(
|
||||||
typeProjectionWithVariance: FirTypeProjectionWithVariance,
|
typeProjectionWithVariance: FirTypeProjectionWithVariance,
|
||||||
@@ -203,7 +207,7 @@ open class FirTypeResolveTransformer : FirTransformer<Nothing?>() {
|
|||||||
|
|
||||||
if (symbol != null) walkSymbols(symbol)
|
if (symbol != null) walkSymbols(symbol)
|
||||||
|
|
||||||
if (type !is FirUserType) return myTransformer.transformType(type, data)
|
if (type !is FirUserType) return type.transform(myTransformer, data)
|
||||||
|
|
||||||
|
|
||||||
type.transformChildren(myTransformer, null)
|
type.transformChildren(myTransformer, null)
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ FILE: derivedClass.kt
|
|||||||
|
|
||||||
}
|
}
|
||||||
<T : Any> public? final class Derived() : Base<T> {
|
<T : Any> public? final class Derived() : Base<T> {
|
||||||
public? constructor(x: T)STUB
|
public? constructor(x: T): super(STUB)
|
||||||
|
|
||||||
}
|
}
|
||||||
<T : Any> public? final? function create(x: T): Derived<T> {
|
<T : Any> public? final? function create(x: T): Derived<T> {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ FILE: nestedClass.kt
|
|||||||
}
|
}
|
||||||
public? final class Outer() {
|
public? final class Outer() {
|
||||||
public? final class Derived() : Base {
|
public? final class Derived() : Base {
|
||||||
public? constructor(s: String)STUB
|
public? constructor(s: String): super(STUB)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Vendored
+6
@@ -0,0 +1,6 @@
|
|||||||
|
interface KMutableProperty1<T> : KProperty1<T>
|
||||||
|
|
||||||
|
interface KProperty1<T> : (T) -> Int
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Vendored
+5
@@ -0,0 +1,5 @@
|
|||||||
|
FILE: ft.kt
|
||||||
|
<T> public? abstract interface KMutableProperty1() : R|KProperty1<T>| {
|
||||||
|
}
|
||||||
|
<T> public? abstract interface KProperty1() : R|(T) -> kotlin/Int| {
|
||||||
|
}
|
||||||
@@ -6,3 +6,11 @@ fun <T, R> List<T>.simpleMap(f: (T) -> R): R {
|
|||||||
|
|
||||||
fun <T> simpleWith(t: T, f: T.() -> Unit): Unit = t.f()
|
fun <T> simpleWith(t: T, f: T.() -> Unit): Unit = t.f()
|
||||||
|
|
||||||
|
interface KMutableProperty1<T, R> : KProperty1<T, R>, KMutableProperty<R>
|
||||||
|
|
||||||
|
interface KProperty1<T, out R> : KProperty<R>, (T) -> R
|
||||||
|
|
||||||
|
interface KProperty<out R>
|
||||||
|
|
||||||
|
interface KMutableProperty<R>
|
||||||
|
|
||||||
|
|||||||
@@ -7,3 +7,11 @@ FILE: functionTypes.kt
|
|||||||
<T> public? final? function simpleWith(t: R|T|, f: R|T.() -> kotlin/Unit|): R|kotlin/Unit| {
|
<T> public? final? function simpleWith(t: R|T|, f: R|T.() -> kotlin/Unit|): R|kotlin/Unit| {
|
||||||
STUB
|
STUB
|
||||||
}
|
}
|
||||||
|
<T, R> public? abstract interface KMutableProperty1() : R|KProperty1<T, R>|, R|KMutableProperty<R>| {
|
||||||
|
}
|
||||||
|
<T, out R> public? abstract interface KProperty1() : R|KProperty<R>|, R|(T) -> R| {
|
||||||
|
}
|
||||||
|
<out R> public? abstract interface KProperty() {
|
||||||
|
}
|
||||||
|
<R> public? abstract interface KMutableProperty() {
|
||||||
|
}
|
||||||
|
|||||||
@@ -39,6 +39,12 @@ public class FirResolveTestCaseGenerated extends AbstractFirResolveTestCase {
|
|||||||
runTest("compiler/testData/fir/resolve/F.kt");
|
runTest("compiler/testData/fir/resolve/F.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("ft.kt")
|
||||||
|
public void testFt() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/fir/resolve/ft.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("functionTypes.kt")
|
@TestMetadata("functionTypes.kt")
|
||||||
public void testFunctionTypes() throws Exception {
|
public void testFunctionTypes() throws Exception {
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/fir/resolve/functionTypes.kt");
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/fir/resolve/functionTypes.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user