Joel Wilcox
04/22/2025, 1:21 AM@ContributesBinding(AppScope::class, binding = binding<ContributedInterface>())
object Impl1 : ContributedInterface, OtherInterface
where I want to evaluate the binding argument of ContributesBinding inside a FirSupertypeGenerationExtension. When the above snippet is defined with the rest of my code in a single module, the binding arg is accessible as a FirFunctionCall which allows me to get its parameterized type ContributedInterface. Once I move the Impl1 snippet to a separate module and compilation, the FirSupertypeGenerationExtension sees the binding arg as a FirAnnotationImpl rather than some type of call. This results in the binding arg coming back as null since we're not able to access the parameterized type.
Any ideas on additional changes I might need to make to support both use-cases and access the argument as a call-type? Also happy to provide more details if neededbnorm
04/22/2025, 1:49 AMFirAnnotationImpl has typeArguments: List<FirTypeProjection> just like a FirFunctionCall does, they just don't share a super class/interface. Should be able to handle both cases if all you need to do is extract the type arguments.
I suspect the different is because in one case it is being parsed from source and in the other it is being read from serialized metadata. We might just have a slight inconsistency.Joel Wilcox
04/22/2025, 1:57 AMbnorm
04/22/2025, 2:05 AMJoel Wilcox
04/22/2025, 7:37 PM