Skip to content

Commit

Permalink
Fix test anonymousObject()
Browse files Browse the repository at this point in the history
  • Loading branch information
kunli2 committed Oct 27, 2023
1 parent 1cbd68e commit 2a66cd0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2571,7 +2571,7 @@ public J visitObjectLiteralExpression(KtObjectLiteralExpression expression, Exec
args = JContainer.empty();
args = args.withMarkers(Markers.build(singletonList(new OmitParentheses(randomId()))));
} else {
if (declaration.getSuperTypeList().getEntries().size() > 1) {
if (declaration.getSuperTypeList().getEntries().size() != 1) {
throw new UnsupportedOperationException("TODO");
}

Expand All @@ -2583,7 +2583,7 @@ public J visitObjectLiteralExpression(KtObjectLiteralExpression expression, Exec
args = args.withMarkers(Markers.EMPTY.addIfAbsent(new OmitParentheses(randomId())));
}

clazz = declaration.getSuperTypeList().accept(this, data).withPrefix(Space.EMPTY);
clazz = (TypeTree) declaration.getSuperTypeList().getEntries().get(0).accept(this, data);
}

// TODO: fix NPE.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ open class Test
fun test ( a : Test ) { }
fun method ( ) {
test ( object : Test ( ) {
test ( object : Test ( ) {
} )
}
"""
Expand Down

0 comments on commit 2a66cd0

Please sign in to comment.