min
09/22/2026, 9:30 AMreturnTypeProvider: (List<FirTypeParameter>) -> ConeKotlinType, when ValueParameterData#typeProvider: (List<FirTypeParameterRef>) -> ConeKotlinType? Why does returnTypeProvider get to see FirTypeParameter impls, when typeProvider is only shown FirTypeParameterRef views?dmitriy.novozhilov
09/22/2026, 9:38 AMFirTypeParameterRef are created for inner classes, which capture type parameter from the outer class:
class Outer<A> {
inner class Inner<B>
}
// Inner.typeParameters = [FirTypeParameterRef(A), FirTypeParameter(B)]
So when you declare a constructor of such an inner class, you could observe both FirTypeParameter and FirTypeParameterRef (as constructors refer to type parameters of the class).
Also the DSL and logic for value parameters creation is shared between simple functions and constructors, so here we have FirTypeParameterRef for both of them. In reality functions will receive `FirTypeParameter`s there all the time.dmitriy.novozhilov
09/22/2026, 9:39 AMreturnTypeProvider, this thing exists only for simple functions (as constructor return type is always know and created automatically). So it was declared with more specific FirTypeParameter in signature.