FIR: add return type to functional type's arguments
This commit is contained in:
committed by
Mikhail Glukhikh
parent
a0176fbde5
commit
aaf4645cef
+2
-1
@@ -88,7 +88,8 @@ class FirTypeResolverImpl(private val session: FirSession) : FirTypeResolver {
|
||||
private fun createFunctionalType(typeRef: FirFunctionTypeRef): ConeClassType {
|
||||
val parameters =
|
||||
listOfNotNull((typeRef.receiverTypeRef as FirResolvedTypeRef?)?.type) +
|
||||
typeRef.valueParameters.map { it.returnTypeRef.coneTypeUnsafe<ConeKotlinType>() }
|
||||
typeRef.valueParameters.map { it.returnTypeRef.coneTypeUnsafe<ConeKotlinType>() } +
|
||||
listOf(typeRef.returnTypeRef.coneTypeUnsafe())
|
||||
return ConeClassTypeImpl(
|
||||
resolveBuiltInQualified(KotlinBuiltIns.getFunctionClassId(typeRef.parametersCount), session).toLookupTag(),
|
||||
parameters.toTypedArray(),
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
FILE: lambda.kt
|
||||
public final fun foo(f: R|kotlin/Function0|): R|kotlin/Unit| {
|
||||
public final fun foo(f: R|kotlin/Function0<kotlin/Unit>|): R|kotlin/Unit| {
|
||||
}
|
||||
public final fun bar(x: R|kotlin/Int|, f: R|kotlin/Function0|): R|kotlin/Unit| {
|
||||
public final fun bar(x: R|kotlin/Int|, f: R|kotlin/Function0<kotlin/Unit>|): R|kotlin/Unit| {
|
||||
}
|
||||
public final fun baz(f: R|kotlin/Function0|, other: R|kotlin/Boolean| = Boolean(true)): R|kotlin/Unit| {
|
||||
public final fun baz(f: R|kotlin/Function0<kotlin/Unit>|, other: R|kotlin/Boolean| = Boolean(true)): R|kotlin/Unit| {
|
||||
}
|
||||
public final fun test(): R|kotlin/Unit| {
|
||||
R|/foo|(<L> = foo@fun <implicit>.<anonymous>(): <implicit> {
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
FILE: ft.kt
|
||||
public abstract interface KMutableProperty1<T> : R|KProperty1<T>| {
|
||||
}
|
||||
public abstract interface KProperty1<T> : R|kotlin/Function1| {
|
||||
public abstract interface KProperty1<T> : R|kotlin/Function1<T, kotlin/Int>| {
|
||||
}
|
||||
|
||||
+4
-4
@@ -1,15 +1,15 @@
|
||||
FILE: functionTypes.kt
|
||||
public final fun <T> simpleRun(f: R|kotlin/Function1|): R|kotlin/Unit| {
|
||||
public final fun <T> simpleRun(f: R|kotlin/Function1<T, kotlin/Unit>|): R|kotlin/Unit| {
|
||||
^simpleRun <Unresolved name: f>#()
|
||||
}
|
||||
public final fun <T, R> R|kotlin/collections/List<T>|.simpleMap(f: R|kotlin/Function1|): R|R| {
|
||||
public final fun <T, R> R|kotlin/collections/List<T>|.simpleMap(f: R|kotlin/Function1<T, R>|): R|R| {
|
||||
}
|
||||
public final fun <T> simpleWith(t: R|T|, f: R|kotlin/Function1|): R|kotlin/Unit| {
|
||||
public final fun <T> simpleWith(t: R|T|, f: R|kotlin/Function1<T, kotlin/Unit>|): R|kotlin/Unit| {
|
||||
^simpleWith R|<local>/t|.<Unresolved name: f>#()
|
||||
}
|
||||
public abstract interface KMutableProperty1<T, R> : R|KProperty1<T, R>|, R|KMutableProperty<R>| {
|
||||
}
|
||||
public abstract interface KProperty1<T, out R> : R|KProperty<R>|, R|kotlin/Function1| {
|
||||
public abstract interface KProperty1<T, out R> : R|KProperty<R>|, R|kotlin/Function1<T, R>| {
|
||||
}
|
||||
public abstract interface KProperty<out R> : R|kotlin/Any| {
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user