diff --git a/src/main/java/org/openrewrite/kotlin/tree/K.java b/src/main/java/org/openrewrite/kotlin/tree/K.java index 6a261e299..db3c6d530 100644 --- a/src/main/java/org/openrewrite/kotlin/tree/K.java +++ b/src/main/java/org/openrewrite/kotlin/tree/K.java @@ -656,7 +656,7 @@ public Constructor(UUID id, Markers markers, J.MethodDeclaration methodDeclarati @Override public Constructor withType(@Nullable JavaType type) { - throw new UnsupportedOperationException("To change the return type of this constructor, use withMethodType(..)"); + return this; // type must be changed on method declaration } @Override diff --git a/src/test/java/org/openrewrite/kotlin/ChangePackageTest.java b/src/test/java/org/openrewrite/kotlin/ChangePackageTest.java index 98e7f3048..c507ff591 100644 --- a/src/test/java/org/openrewrite/kotlin/ChangePackageTest.java +++ b/src/test/java/org/openrewrite/kotlin/ChangePackageTest.java @@ -16,7 +16,6 @@ package org.openrewrite.kotlin; import org.junit.jupiter.api.Test; -import org.junitpioneer.jupiter.ExpectedToFail; import org.openrewrite.DocumentExample; import org.openrewrite.Issue; import org.openrewrite.PathUtils; @@ -169,7 +168,6 @@ class Dog : Animal() { ); } - @ExpectedToFail @Issue("https://github.com/openrewrite/rewrite-kotlin/issues/433") @Test void changePackageSecondaryConstructor() { diff --git a/src/test/java/org/openrewrite/kotlin/ChangeTypeTest.java b/src/test/java/org/openrewrite/kotlin/ChangeTypeTest.java index 6e160b978..ba36b2c70 100644 --- a/src/test/java/org/openrewrite/kotlin/ChangeTypeTest.java +++ b/src/test/java/org/openrewrite/kotlin/ChangeTypeTest.java @@ -375,7 +375,6 @@ class A(val a: Metrics) ); } - @ExpectedToFail @Issue("https://github.com/openrewrite/rewrite-kotlin/issues/433") @Test void changeImportSecondaryConstructor() {