protected JvmTypeReference inferFunctionReturnType ( XExpression body ) { XExpression expr = body ; boolean stop = false ; while ( ! stop && expr instanceof XBlockExpression ) { final XBlockExpression block = ( XBlockExpression ) expr ; switch ( block . getExpressions ( ) . size ( ) ) { case 0 : expr = null ; break ; case 1 : expr = block . getExpressions ( ) . get ( 0 ) ; break ; default : stop = true ; } } if ( expr == null || expr instanceof XAssignment || expr instanceof XVariableDeclaration || expr instanceof SarlBreakExpression || expr instanceof SarlContinueExpression || expr instanceof SarlAssertExpression ) { return this . _typeReferenceBuilder . typeRef ( Void . TYPE ) ; } return this . typeBuilder . inferredType ( body ) ; }
Infer the function s return type .