Do not show "assertFailsWith" in any smart completion
This commit is contained in:
@@ -128,19 +128,15 @@ class FuzzyType(
|
|||||||
|
|
||||||
constraintSystem.fixVariables()
|
constraintSystem.fixVariables()
|
||||||
|
|
||||||
if (!constraintSystem.getStatus().hasContradiction()) {
|
if (constraintSystem.getStatus().hasContradiction()) return null
|
||||||
// currently ConstraintSystem return successful status in case there are problems with nullability
|
|
||||||
// that's why we have to check subtyping manually
|
// currently ConstraintSystem return successful status in case there are problems with nullability
|
||||||
val substitutor = constraintSystem.getResultingSubstitutor()
|
// that's why we have to check subtyping manually
|
||||||
val substitutedType = substitutor.substitute(type, Variance.INVARIANT)
|
val substitutor = constraintSystem.getResultingSubstitutor()
|
||||||
val otherSubstitutedType = substitutor.substitute(otherType.type, Variance.INVARIANT)
|
val substitutedType = substitutor.substitute(type, Variance.INVARIANT) ?: return null
|
||||||
return if (substitutedType != null && otherSubstitutedType != null && substitutedType.checkInheritance(otherSubstitutedType))
|
if (substitutedType.isError) return null
|
||||||
constraintSystem.getPartialSubstitutor()
|
val otherSubstitutedType = substitutor.substitute(otherType.type, Variance.INVARIANT) ?: return null
|
||||||
else
|
if (otherSubstitutedType.isError) return null
|
||||||
null
|
return if (substitutedType.checkInheritance(otherSubstitutedType)) constraintSystem.getPartialSubstitutor() else null
|
||||||
}
|
|
||||||
else {
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
import kotlin.test.*
|
||||||
|
|
||||||
|
interface I<T>
|
||||||
|
|
||||||
|
fun <T> foo(i: I<T>){}
|
||||||
|
|
||||||
|
fun bar() {
|
||||||
|
foo(ass<caret>)
|
||||||
|
}
|
||||||
|
|
||||||
|
// ABSENT: assertFailsWith
|
||||||
+6
@@ -323,6 +323,12 @@ public class JvmSmartCompletionTestGenerated extends AbstractJvmSmartCompletionT
|
|||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("NoAssertFailsWith.kt")
|
||||||
|
public void testNoAssertFailsWith() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("idea/idea-completion/testData/smart/NoAssertFailsWith.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("NoExtensionMethodFromClassObject.kt")
|
@TestMetadata("NoExtensionMethodFromClassObject.kt")
|
||||||
public void testNoExtensionMethodFromClassObject() throws Exception {
|
public void testNoExtensionMethodFromClassObject() throws Exception {
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("idea/idea-completion/testData/smart/NoExtensionMethodFromClassObject.kt");
|
String fileName = KotlinTestUtils.navigationMetadata("idea/idea-completion/testData/smart/NoExtensionMethodFromClassObject.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user