```private fun FirSession.nullaryAnnotationFromId(...
# compiler
m
Copy code
private 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
?
y
If you don't have type parameters, I think they're the same IIRC, `defaultType`is the type inside the class, I.e. if you have
class 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 implementation
m
@Youssef Shoaib [MOD] Thanks! Are you also familiar with the difference between
FirReceiverParameterSymbol#resolvedType
and
FirReceiverParameterSymbol#fir#typeRef
?