Revert "[NI] Take into account captured types for type depth computation"

This reverts commit 383c2d1bff.

 It seems this commit causes problems with bootstraping, so it'll be
 investigated and refined later
This commit is contained in:
Mikhail Zarechenskiy
2018-12-12 17:28:51 +03:00
parent fdf4f02dde
commit 1d69f35f27
5 changed files with 0 additions and 62 deletions
@@ -470,9 +470,6 @@ internal fun UnwrappedType.typeDepth() =
internal fun SimpleType.typeDepth(): Int {
if (this is TypeUtils.SpecialType) return 0
if (this is NewCapturedType) {
return constructor.projection.type.unwrap().typeDepth()
}
val maxInArguments = arguments.asSequence().map {
if (it.isStarProjection) 1 else it.type.unwrap().typeDepth()
@@ -1,36 +0,0 @@
// !LANGUAGE: +NewInference
// !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER
class Inv<T>(val x: T)
fun case_1(a: Inv<out Inv<Inv<Inv<Inv<Inv<Int?>?>?>?>?>?>?) {
if (a != null) {
val b: Inv<out Inv<out Inv<out Inv<out Inv<Int?>?>?>?>?>? = a.x
}
}
fun case_2(a: Inv<out Inv<Inv<Inv<Inv<Inv<Int?>?>?>?>?>?>?) {
if (a != null) {
val b: Inv<out Inv<out Inv<out Inv<out Inv<Int?>?>?>?>?>? = a.x
if (b != null) {
val c = b.x
if (c != null) {
val d = c.x
if (d != null) {
val e = d.x
if (e != null) {
val f = e.x
if (f != null) {
val g = <!DEBUG_INFO_SMARTCAST!>f<!>.x
if (g != null) {
takeInt(<!DEBUG_INFO_SMARTCAST!>g<!>)
}
}
}
}
}
}
}
}
fun takeInt(i: Int) {}
@@ -1,13 +0,0 @@
package
public fun case_1(/*0*/ a: Inv<out Inv<Inv<Inv<Inv<Inv<kotlin.Int?>?>?>?>?>?>?): kotlin.Unit
public fun case_2(/*0*/ a: Inv<out Inv<Inv<Inv<Inv<Inv<kotlin.Int?>?>?>?>?>?>?): kotlin.Unit
public fun takeInt(/*0*/ i: kotlin.Int): kotlin.Unit
public final class Inv</*0*/ T> {
public constructor Inv</*0*/ T>(/*0*/ x: T)
public final val x: 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
}
@@ -7948,11 +7948,6 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest {
runTest("compiler/testData/diagnostics/tests/generics/argumentsForT.kt");
}
@TestMetadata("capturingOfDeepNestedType.kt")
public void testCapturingOfDeepNestedType() throws Exception {
runTest("compiler/testData/diagnostics/tests/generics/capturingOfDeepNestedType.kt");
}
@TestMetadata("commonSupertypeContravariant.kt")
public void testCommonSupertypeContravariant() throws Exception {
runTest("compiler/testData/diagnostics/tests/generics/commonSupertypeContravariant.kt");
@@ -7948,11 +7948,6 @@ public class DiagnosticsUsingJavacTestGenerated extends AbstractDiagnosticsUsing
runTest("compiler/testData/diagnostics/tests/generics/argumentsForT.kt");
}
@TestMetadata("capturingOfDeepNestedType.kt")
public void testCapturingOfDeepNestedType() throws Exception {
runTest("compiler/testData/diagnostics/tests/generics/capturingOfDeepNestedType.kt");
}
@TestMetadata("commonSupertypeContravariant.kt")
public void testCommonSupertypeContravariant() throws Exception {
runTest("compiler/testData/diagnostics/tests/generics/commonSupertypeContravariant.kt");