Skip to content

Commit

Permalink
fix test case methodName
Browse files Browse the repository at this point in the history
  • Loading branch information
kunli2 committed Oct 10, 2023
1 parent 37dde26 commit a4f6cf3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -826,15 +826,23 @@ public J visitTypeParameter(KtTypeParameter parameter, ExecutionContext data) {
Markers markers = Markers.EMPTY;
List<J.Annotation> annotations = new ArrayList<>();

J.Identifier name = createIdentifier(parameter, type(parameter));
if (parameter.getNameIdentifier() == null) {
throw new UnsupportedOperationException("TODO");
}

J.Identifier name = createIdentifier(parameter.getNameIdentifier(), type(parameter));
JContainer<TypeTree> bounds = JContainer.build(suffix(parameter.getNameIdentifier()),
singletonList(padRight(parameter.getExtendsBound().accept(this, data).withPrefix(prefix(parameter.getExtendsBound())),
Space.EMPTY)),
Markers.EMPTY);

return new J.TypeParameter(
randomId(),
prefix(parameter),
markers,
annotations,
name,
null
bounds
);
}

Expand Down Expand Up @@ -1662,7 +1670,7 @@ private J.MethodDeclaration visitNamedFunction0(KtNamedFunction function, Execut
List<JRightPadded<J.TypeParameter>> params = new ArrayList<>(ktTypeParameters.size());

for (KtTypeParameter ktTypeParameter : ktTypeParameters) {
J.TypeParameter typeParameter = ktTypeParameter.accept(this, data).withPrefix(Space.EMPTY);
J.TypeParameter typeParameter = ktTypeParameter.accept(this, data).withPrefix(prefix(ktTypeParameter));
params.add(padRight(typeParameter, suffix(ktTypeParameter)));
}

Expand Down
7 changes: 0 additions & 7 deletions src/test/java/org/openrewrite/kotlin/tree/ImportTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,6 @@ class A {
);
}

@Test
void debug() {
rewriteRun(
kotlin("fun < T : Any > Class < T > . createInstance( ) { }")
);
}

@Issue("https://github.com/openrewrite/rewrite-kotlin/issues/158")
@Test
void methodName() {
Expand Down

0 comments on commit a4f6cf3

Please sign in to comment.