Godwin Joseph
03/21/2022, 5:09 PMval element: KtNamedFunction =//from another FUN
if(element.typeReference!= null){
if (it.text != "Unit") {
print(return type)
}
}
Sample function 1
fun abc():Int{
return 0
}
Sample function 2
fun abcd()=0
When executing the first function I am getting Int
as the typeReference. But when executing the second, I am getting null
as typeReference.
Why I am getting null
when using Single-expression functions? How to solve it?