ReturnStatus (PsiElement subject) { if (subject instanceof GrClosableBlock) { final PsiType inferredReturnType = getExpectedClosureReturnType((GrClosableBlock)subject); if (inferredReturnType instanceof PsiClassType) { PsiClass resolved = ((PsiClassType)inferredReturnType).resolve(); if (resolved != null && !(resolved instanceof PsiTypeParameter)) return mustReturnValue; } return inferredReturnType != null && !PsiTypes.voidType().equals(inferredReturnType) ? shouldReturnValue : shouldNotReturnValue; } else if (subject instanceof GrMethod) { return ((GrMethod)subject).getReturnTypeElementGroovy() != null && !PsiTypes.voidType().equals(((GrMethod)subject).getReturnType()) ? mustReturnValue : shouldNotReturnValue; } return shouldNotReturnValue; }