Refactor: add hasBody() to JetDeclarationWithBody interface
Use it where appropriate
This commit is contained in:
+2
-2
@@ -102,11 +102,11 @@ public final class PropertyTranslator extends AbstractTranslator {
|
||||
}
|
||||
|
||||
private boolean hasCustomGetter() {
|
||||
return declaration != null && declaration.getGetter() != null && getCustomGetterDeclaration().getBodyExpression() != null;
|
||||
return declaration != null && declaration.getGetter() != null && getCustomGetterDeclaration().hasBody();
|
||||
}
|
||||
|
||||
private boolean hasCustomSetter() {
|
||||
return declaration != null && declaration.getSetter() != null && getCustomSetterDeclaration().getBodyExpression() != null;
|
||||
return declaration != null && declaration.getSetter() != null && getCustomSetterDeclaration().hasBody();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
+1
-2
@@ -110,8 +110,7 @@ public final class FunctionTranslator extends AbstractTranslator {
|
||||
}
|
||||
|
||||
private void translateBody() {
|
||||
JetExpression jetBodyExpression = functionDeclaration.getBodyExpression();
|
||||
if (jetBodyExpression == null) {
|
||||
if (!functionDeclaration.hasBody()) {
|
||||
assert descriptor.getModality().equals(Modality.ABSTRACT);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user