Revert "Fix ISE when inferring type of a property that delegates to itself"
This reverts commit 1a03d5c93e.
The reason is that original change seems to be breaking (see KT-44137).
^KT-44137 Relates
^KT-37796 Open
This commit is contained in:
-6
@@ -6957,12 +6957,6 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti
|
|||||||
runTest("compiler/testData/diagnostics/tests/delegatedProperty/incompleteTypeInference.kt");
|
runTest("compiler/testData/diagnostics/tests/delegatedProperty/incompleteTypeInference.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
@TestMetadata("kt37796.kt")
|
|
||||||
public void testKt37796() throws Exception {
|
|
||||||
runTest("compiler/testData/diagnostics/tests/delegatedProperty/kt37796.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("kt4640.kt")
|
@TestMetadata("kt4640.kt")
|
||||||
public void testKt4640() throws Exception {
|
public void testKt4640() throws Exception {
|
||||||
|
|||||||
@@ -545,12 +545,7 @@ class DelegatedPropertyResolver(
|
|||||||
traceToResolveDelegatedProperty, false, delegateExpression, ContextDependency.DEPENDENT
|
traceToResolveDelegatedProperty, false, delegateExpression, ContextDependency.DEPENDENT
|
||||||
)
|
)
|
||||||
|
|
||||||
if (delegateTypeInfo.type == null) {
|
var delegateType = delegateTypeInfo.type ?: return null
|
||||||
traceToResolveDelegatedProperty.commit()
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
|
|
||||||
var delegateType = delegateTypeInfo.type
|
|
||||||
var delegateDataFlow = delegateTypeInfo.dataFlowInfo
|
var delegateDataFlow = delegateTypeInfo.dataFlowInfo
|
||||||
|
|
||||||
val delegateTypeConstructor = delegateType.constructor
|
val delegateTypeConstructor = delegateType.constructor
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
val foo by <!UNRESOLVED_REFERENCE!>foo<!>
|
|
||||||
|
|
||||||
val bar by <!UNRESOLVED_REFERENCE!><!INAPPLICABLE_CANDIDATE!>baz<!>(bar)<!>
|
|
||||||
|
|
||||||
fun <T> baz(t: T): T = t
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
val foo by <!DEBUG_INFO_MISSING_UNRESOLVED, TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM!>foo<!>
|
|
||||||
|
|
||||||
val bar by <!DELEGATE_SPECIAL_FUNCTION_MISSING!>baz(<!DEBUG_INFO_MISSING_UNRESOLVED, TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM!>bar<!>)<!>
|
|
||||||
|
|
||||||
fun <T> baz(t: T): T = t
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
package
|
|
||||||
|
|
||||||
public val bar: [ERROR : Type from delegate]
|
|
||||||
public val foo: [ERROR : <ERROR FUNCTION RETURN TYPE>]
|
|
||||||
public fun </*0*/ T> baz(/*0*/ t: T): T
|
|
||||||
|
|
||||||
@@ -4,12 +4,12 @@
|
|||||||
|
|
||||||
import kotlin.reflect.KProperty
|
import kotlin.reflect.KProperty
|
||||||
|
|
||||||
val a by <!DEBUG_INFO_MISSING_UNRESOLVED, TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM!>a<!>
|
val a by <!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE{NI}, TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM{OI}!>a<!>
|
||||||
|
|
||||||
val b by Delegate(<!DEBUG_INFO_MISSING_UNRESOLVED{NI}, TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM!>b<!>)
|
val b by Delegate(<!DEBUG_INFO_MISSING_UNRESOLVED{NI}, TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM!>b<!>)
|
||||||
|
|
||||||
val c by <!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE, UNINITIALIZED_VARIABLE!>d<!>
|
val c by <!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE, UNINITIALIZED_VARIABLE!>d<!>
|
||||||
val d by <!DEBUG_INFO_MISSING_UNRESOLVED, TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM!>c<!>
|
val d by <!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE{NI}, TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM{OI}!>c<!>
|
||||||
|
|
||||||
class Delegate(i: Int) {
|
class Delegate(i: Int) {
|
||||||
operator fun getValue(t: Any?, p: KProperty<*>): Int {
|
operator fun getValue(t: Any?, p: KProperty<*>): Int {
|
||||||
|
|||||||
Generated
-6
@@ -6963,12 +6963,6 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
|
|||||||
runTest("compiler/testData/diagnostics/tests/delegatedProperty/incompleteTypeInference.kt");
|
runTest("compiler/testData/diagnostics/tests/delegatedProperty/incompleteTypeInference.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
@TestMetadata("kt37796.kt")
|
|
||||||
public void testKt37796() throws Exception {
|
|
||||||
runTest("compiler/testData/diagnostics/tests/delegatedProperty/kt37796.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("kt4640.kt")
|
@TestMetadata("kt4640.kt")
|
||||||
public void testKt4640() throws Exception {
|
public void testKt4640() throws Exception {
|
||||||
|
|||||||
Reference in New Issue
Block a user