Remove wrong assertion

This commit is contained in:
Denis Zharkov
2016-01-25 16:42:09 +03:00
parent 29c24267fa
commit e69b115d9a
4 changed files with 36 additions and 1 deletions
@@ -0,0 +1,19 @@
// FILE: A.java
import java.util.*;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public class A<T> {
@NotNull
public T bar() {
}
}
// FILE: k.kt
fun test(a: A<out CharSequence>) {
a.bar()<!UNNECESSARY_SAFE_CALL!>?.<!>length
a.bar()<!UNNECESSARY_SAFE_CALL!>?.<!>length
}
@@ -0,0 +1,11 @@
package
public fun test(/*0*/ a: A<out kotlin.CharSequence>): kotlin.Unit
public open class A</*0*/ T : kotlin.Any!> {
public constructor A</*0*/ T : kotlin.Any!>()
@org.jetbrains.annotations.NotNull() public open fun bar(): T
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
@@ -12473,6 +12473,12 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest {
doTest(fileName);
}
@TestMetadata("onTypeProjection.kt")
public void testOnTypeProjection() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/platformTypes/notNullTypeParameter/onTypeProjection.kt");
doTest(fileName);
}
@TestMetadata("substitutionInSuperType.kt")
public void testSubstitutionInSuperType() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/platformTypes/notNullTypeParameter/substitutionInSuperType.kt");
@@ -522,7 +522,6 @@ public class TypeUtils {
}
@Nullable
public static TypeParameterDescriptor getTypeParameterDescriptorOrNull(@NotNull KotlinType type) {
assert !(type instanceof CapturedType) : "Type should be non-captured " + type;
if (type.getConstructor().getDeclarationDescriptor() instanceof TypeParameterDescriptor) {
return (TypeParameterDescriptor) type.getConstructor().getDeclarationDescriptor();
}