diff --git a/java/java-tests/testData/codeInsight/completion/normalSorting/CommonPrefixMoreImportantThanExpectedType.java b/java/java-tests/testData/codeInsight/completion/normalSorting/CommonPrefixMoreImportantThanExpectedType.java new file mode 100644 index 000000000000..90a2ffbcee4b --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/normalSorting/CommonPrefixMoreImportantThanExpectedType.java @@ -0,0 +1,8 @@ + +public class Foo { + int myCurrentStep = null; + Object myStep = null; + void foo() { + int a = myst + } +} \ No newline at end of file diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/completion/NormalCompletionOrderingTest.groovy b/java/java-tests/testSrc/com/intellij/codeInsight/completion/NormalCompletionOrderingTest.groovy index 2527ea81227e..12121e05c889 100644 --- a/java/java-tests/testSrc/com/intellij/codeInsight/completion/NormalCompletionOrderingTest.groovy +++ b/java/java-tests/testSrc/com/intellij/codeInsight/completion/NormalCompletionOrderingTest.groovy @@ -470,4 +470,8 @@ import java.lang.annotation.Target; assertPreferredItems 0, 'myClass', 'myExtendsClause' } + public void _testCommonPrefixMoreImportantThanExpectedType() { + checkPreferredItems 0, 'myStep', 'myCurrentStep' + } + }