Liyue
03/02/2021, 9:41 AMValueParameterDescriptor
, but when the function comes from a class file, it doesn't work.
fun parseKtCallExpr(callExpr: KtCallExpression, bindingContext:BindingContext){
val resolvedCall = callExpr.getResolvedCall(bindingContext)
val defaultParam : ValueParameterDescriptor = resolvedCall.valueArguments[0].key // Suppose it has defaultvalue
defaultParam.findPsi() as? KtParameter)?.defaultValue // it works only when function come from code.
}
Is there any way to get it? Thanks.Youssef Shoaib [MOD]
03/02/2021, 12:57 PMdefaultParam.getCompileTimeInitializer()
udalov
Liyue
03/03/2021, 1:52 AM