Skip to content

Commit

Permalink
support abstract receriver
Browse files Browse the repository at this point in the history
  • Loading branch information
kunli2 committed Oct 8, 2023
1 parent fc1afa9 commit 023de9c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,7 @@ public J visitTypeParameterList(KtTypeParameterList list, ExecutionContext data)
@Override
public J visitTypeProjection(KtTypeProjection typeProjection, ExecutionContext data) {
if (typeProjection.getTypeReference() != null) {
return typeProjection.getTypeReference().accept(this, data);
return typeProjection.getTypeReference().accept(this, data).withPrefix(prefix(typeProjection));
}

if (typeProjection.getProjectionKind() == KtProjectionKind.STAR) {
Expand Down Expand Up @@ -1737,7 +1737,7 @@ public J visitProperty(KtProperty property, ExecutionContext data) {
variables
);

if (getter != null || setter != null) {
if (getter != null || setter != null || receiver != null) {
return new K.Property(
randomId(),
Space.EMPTY,
Expand Down Expand Up @@ -1900,8 +1900,6 @@ public J visitUserType(KtUserType type, ExecutionContext data) {
);
}


// TODO: fix NPE.
return nameTree;
}

Expand Down Expand Up @@ -1961,6 +1959,8 @@ private J.Modifier.Type mapModifierType(PsiElement modifier) {
return J.Modifier.Type.Sealed;
case "open":
return J.Modifier.Type.LanguageExtension;
case "abstract":
return J.Modifier.Type.Abstract;
default:
throw new UnsupportedOperationException("Unsupported ModifierType : " + modifier);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ void abstractReceiver() {
"""
class SomeParameterized<T>
abstract class Test {
abstract val SomeParameterized < Int > . receivedMember : Int
abstract val SomeParameterized < Int > . receivedMember : Int
}
"""
)
Expand Down

0 comments on commit 023de9c

Please sign in to comment.