hasBlockBody() is wrong?


#1

Hello, I found that org.jetbrains.jet.lang.psi.JetNamedFunction#hasBlockBody return true even for abstract functions. I think this is not right. Actually I tried to use it to distinguish abstract and not abstract functions. Can I fill issue to youtrack or this method have another meaning?


#2

hasBlockBody() mans that if this function's body exists, it's a block and not a single expression (like in "fun foo() = 5").

To check whether funciton has a body, compare it’s getBosyExpression() to null.

Note: determining whether a function is abstract by PSI might be not a good idea. Descriptors are always a better choise, if available.