From 560eafac3cf91716374054e22ab81f3d79e840a6 Mon Sep 17 00:00:00 2001 From: Frederik Haselmeier Date: Wed, 19 Nov 2025 18:14:39 +0100 Subject: [PATCH] [kotlin] KTIJ-36513 Added tests GitOrigin-RevId: 5de8d51703cf645a8b37c5c6d7b833b5b4e8e94e --- .../expectedType/overrideWithoutExplicitType.kt | 15 +++++++++++++++ .../BasicCompletionWeigherTestGenerated.java | 5 +++++ .../wheigher/HighLevelWeigherTestGenerated.java | 5 +++++ 3 files changed, 25 insertions(+) create mode 100644 plugins/kotlin/completion/testData/weighers/basic/expectedType/overrideWithoutExplicitType.kt diff --git a/plugins/kotlin/completion/testData/weighers/basic/expectedType/overrideWithoutExplicitType.kt b/plugins/kotlin/completion/testData/weighers/basic/expectedType/overrideWithoutExplicitType.kt new file mode 100644 index 000000000000..940b30ac6cf3 --- /dev/null +++ b/plugins/kotlin/completion/testData/weighers/basic/expectedType/overrideWithoutExplicitType.kt @@ -0,0 +1,15 @@ +class SomePrefixA +class SomePrefixB +class SomePrefixC + +open class OpenClass { + open val test: SomePrefixB = SomePrefixB() +} + +class DerivedClass : OpenClass() { + override val test = SomePrefix +} + +// ORDER: SomePrefixB, SomePrefixA, SomePrefixC +// IGNORE_K1 +// IGNORE_K2 \ No newline at end of file diff --git a/plugins/kotlin/completion/tests-k1/test/org/jetbrains/kotlin/idea/completion/test/weighers/BasicCompletionWeigherTestGenerated.java b/plugins/kotlin/completion/tests-k1/test/org/jetbrains/kotlin/idea/completion/test/weighers/BasicCompletionWeigherTestGenerated.java index c1b774f7f99e..3d76a0d329fb 100644 --- a/plugins/kotlin/completion/tests-k1/test/org/jetbrains/kotlin/idea/completion/test/weighers/BasicCompletionWeigherTestGenerated.java +++ b/plugins/kotlin/completion/tests-k1/test/org/jetbrains/kotlin/idea/completion/test/weighers/BasicCompletionWeigherTestGenerated.java @@ -356,6 +356,11 @@ public abstract class BasicCompletionWeigherTestGenerated extends AbstractBasicC runTest("../testData/weighers/basic/expectedType/MatchingNullableType.kt"); } + @TestMetadata("overrideWithoutExplicitType.kt") + public void testOverrideWithoutExplicitType() throws Exception { + runTest("../testData/weighers/basic/expectedType/overrideWithoutExplicitType.kt"); + } + @TestMetadata("propertyAccessor.kt") public void testPropertyAccessor() throws Exception { runTest("../testData/weighers/basic/expectedType/propertyAccessor.kt"); diff --git a/plugins/kotlin/fir/tests/test/org/jetbrains/kotlin/idea/fir/completion/wheigher/HighLevelWeigherTestGenerated.java b/plugins/kotlin/fir/tests/test/org/jetbrains/kotlin/idea/fir/completion/wheigher/HighLevelWeigherTestGenerated.java index 4597d049e3c1..a90fbb47b625 100644 --- a/plugins/kotlin/fir/tests/test/org/jetbrains/kotlin/idea/fir/completion/wheigher/HighLevelWeigherTestGenerated.java +++ b/plugins/kotlin/fir/tests/test/org/jetbrains/kotlin/idea/fir/completion/wheigher/HighLevelWeigherTestGenerated.java @@ -356,6 +356,11 @@ public abstract class HighLevelWeigherTestGenerated extends AbstractHighLevelWei runTest("../../completion/testData/weighers/basic/expectedType/MatchingNullableType.kt"); } + @TestMetadata("overrideWithoutExplicitType.kt") + public void testOverrideWithoutExplicitType() throws Exception { + runTest("../../completion/testData/weighers/basic/expectedType/overrideWithoutExplicitType.kt"); + } + @TestMetadata("propertyAccessor.kt") public void testPropertyAccessor() throws Exception { runTest("../../completion/testData/weighers/basic/expectedType/propertyAccessor.kt");