Skip to content

Commit

Permalink
correct setter/getter order
Browse files Browse the repository at this point in the history
  • Loading branch information
kunli2 committed Oct 10, 2023
1 parent 09f65b1 commit 33a1cbf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -671,10 +671,6 @@ public J visitPropertyAccessor(KtPropertyAccessor accessor, ExecutionContext dat
returnTypeExpression = accessor.getReturnTypeReference().accept(this, data).withPrefix(prefix(accessor.getReturnTypeReference()));
}

if (accessor.getBodyBlockExpression() != accessor.getBodyExpression()) {
throw new UnsupportedOperationException("TODO. check what is the scenario for this case");
}

if (accessor.getBodyBlockExpression() != null) {
body = accessor.getBodyBlockExpression().accept(this, data).withPrefix(prefix(accessor.getBodyBlockExpression()));
} else if (accessor.getBodyExpression() != null) {
Expand Down Expand Up @@ -2019,6 +2015,10 @@ public J visitProperty(KtProperty property, ExecutionContext data) {
setter = (J.MethodDeclaration) property.getSetter().accept(this, data);
}

if (getter != null && setter != null) {
isSetterFirst = property.getSetter().getTextRange().getStartOffset() < property.getGetter().getTextRange().getStartOffset();
}

if (property.getLastChild().getNode().getElementType() == KtTokens.SEMICOLON) {
throw new UnsupportedOperationException("TODO");
} else if (!property.getAnnotationEntries().isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ void deSugar() {
);
}

@ExpectedToFail("Improved to present !in to a KBinary")
@Test
void yikes() {
rewriteRun(
Expand Down Expand Up @@ -257,6 +258,7 @@ class Test < T >
);
}

@ExpectedToFail("Improved type, condition has a owner now")
@Test
void ifElseExpression() {
rewriteRun(
Expand Down

0 comments on commit 33a1cbf

Please sign in to comment.