Do not show "assertFailsWith" in any smart completion
This commit is contained in:
@@ -128,19 +128,15 @@ class FuzzyType(
|
||||
|
||||
constraintSystem.fixVariables()
|
||||
|
||||
if (!constraintSystem.getStatus().hasContradiction()) {
|
||||
// currently ConstraintSystem return successful status in case there are problems with nullability
|
||||
// that's why we have to check subtyping manually
|
||||
val substitutor = constraintSystem.getResultingSubstitutor()
|
||||
val substitutedType = substitutor.substitute(type, Variance.INVARIANT)
|
||||
val otherSubstitutedType = substitutor.substitute(otherType.type, Variance.INVARIANT)
|
||||
return if (substitutedType != null && otherSubstitutedType != null && substitutedType.checkInheritance(otherSubstitutedType))
|
||||
constraintSystem.getPartialSubstitutor()
|
||||
else
|
||||
null
|
||||
}
|
||||
else {
|
||||
return null
|
||||
}
|
||||
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
|
||||
val substitutor = constraintSystem.getResultingSubstitutor()
|
||||
val substitutedType = substitutor.substitute(type, Variance.INVARIANT) ?: return null
|
||||
if (substitutedType.isError) return null
|
||||
val otherSubstitutedType = substitutor.substitute(otherType.type, Variance.INVARIANT) ?: return null
|
||||
if (otherSubstitutedType.isError) return null
|
||||
return if (substitutedType.checkInheritance(otherSubstitutedType)) constraintSystem.getPartialSubstitutor() else 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);
|
||||
}
|
||||
|
||||
@TestMetadata("NoAssertFailsWith.kt")
|
||||
public void testNoAssertFailsWith() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/idea-completion/testData/smart/NoAssertFailsWith.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("NoExtensionMethodFromClassObject.kt")
|
||||
public void testNoExtensionMethodFromClassObject() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/idea-completion/testData/smart/NoExtensionMethodFromClassObject.kt");
|
||||
|
||||
Reference in New Issue
Block a user