Esya Bekasova
08/01/2026, 5:33 AMEsya Bekasova
08/01/2026, 5:33 AMEsya Bekasova
08/01/2026, 5:44 AMJakob Villumsen
08/06/2026, 2:27 PMKSFunctionDeclaration which can be obtained from the KSType. Is that correctly understood or how are you using KSFunctionType? CheersEsya Bekasova
08/07/2026, 5:14 AMKSFunctionType to parse a functional type (A.(p1: Int) -> Unit) into its constituent parts. In my KSP plugin syntax/design, the developer describes a target bytecode scheme similar to this:
@Method<(graphics: GuiGraphicsExtractor, x: Int, y: Int, isSelected: Boolean, index: Int) -> Unit>
interface extractRenderState
The thing is that KSType only has the isFunctionType flag, but it has no ability to extract the internal structure.
So, KSFunctionDeclaration is not suitable here, since it is a function and not a function type.
Under the hood, the functional type is converted into a Function(0-22/N) generic, and in order not to lose information about context parameters, the presence of a receiver, and parameter names, the Kotlin compiler inserts the annotations @ContextFunctionTypeParams, @ExtensionFunctionType and @ParameterName , respectively.
It seemed to me that this information could be extracted at the level of KSP itself and an interface could be provided for this so that other developers wouldn't have to understand these subtleties and not have to mess with the compiler 🙂Jakob Villumsen
08/18/2026, 11:07 AMEsya Bekasova
08/18/2026, 8:45 PM