min
10/02/2026, 6:35 AMprivate fun FirSession.nullaryAnnotationFromId(id: ClassId): FirAnnotation? {
val annotationTypeRef = this.classFromId(id)
?.defaultType() // Or should I use `constructType` here?
?.toFirResolvedTypeRef() ?: return null
return buildAnnotationCall(fun (callBuilder) {
callBuilder.annotationTypeRef = annotationTypeRef
})
}
What’s the difference between defaultType and constructType?Youssef Shoaib [MOD]
10/02/2026, 6:41 AMclass Foo<T> the default type is Foo<T> (yes including the type parameter). constructType actually creates a type and lets you pass in type arguments, so it's almost surely what you want here.
Purely operating from memory though. I'd Go To Definition on each and see the implementationmin
10/02/2026, 7:45 AMFirReceiverParameterSymbol#resolvedType and FirReceiverParameterSymbol#fir#typeRef?