NI: Fix property references overload ambiguity
^KT-35213 Fixed
This commit is contained in:
Generated
+5
@@ -2410,6 +2410,11 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirOldFronte
|
||||
runTest("compiler/testData/diagnostics/tests/callableReference/property/extensionPropertyOnNullable.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("extensionsSameName.kt")
|
||||
public void testExtensionsSameName() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/callableReference/property/extensionsSameName.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("genericClass.kt")
|
||||
public void testGenericClass() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/callableReference/property/genericClass.kt");
|
||||
|
||||
+3
-3
@@ -191,8 +191,8 @@ private fun ConstraintSystemBuilder.addConstraintFromLHS(lhsResult: LHSResult.Ty
|
||||
|
||||
when (expectedTypeProjectionForLHS.projectionKind) {
|
||||
Variance.INVARIANT -> addEqualityConstraint(lhsType, expectedTypeForLHS, constraintPosition)
|
||||
Variance.IN_VARIANCE -> addSubtypeConstraint(expectedType, lhsType, constraintPosition)
|
||||
Variance.OUT_VARIANCE -> addSubtypeConstraint(lhsType, expectedType, constraintPosition)
|
||||
Variance.IN_VARIANCE -> addSubtypeConstraint(expectedTypeForLHS, lhsType, constraintPosition)
|
||||
Variance.OUT_VARIANCE -> addSubtypeConstraint(lhsType, expectedTypeForLHS, constraintPosition)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -207,4 +207,4 @@ private fun preprocessCollectionLiteralArgument(
|
||||
internal inline fun <reified T : Any> Any.requireIs(): T {
|
||||
require(this is T)
|
||||
return this
|
||||
}
|
||||
}
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
// SKIP_TXT
|
||||
// !LANGUAGE: +NewInference
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
fun check1(p: kotlin.reflect.KProperty1<*, *>) {}
|
||||
fun check2(p: kotlin.reflect.KProperty1<in String, *>) {}
|
||||
|
||||
val CharSequence.x: Any get() = this
|
||||
val BooleanArray.x: Any get() = this
|
||||
|
||||
fun box() {
|
||||
check1(CharSequence::x) // error in NI, ok in OI
|
||||
check2(CharSequence::x)
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
// SKIP_TXT
|
||||
// !LANGUAGE: +NewInference
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
fun check1(p: kotlin.reflect.KProperty1<*, *>) {}
|
||||
fun check2(p: kotlin.reflect.KProperty1<in String, *>) {}
|
||||
|
||||
val CharSequence.x: Any get() = this
|
||||
val BooleanArray.x: Any get() = this
|
||||
|
||||
fun box() {
|
||||
check1(CharSequence::x) // error in NI, ok in OI
|
||||
check2(CharSequence::x)
|
||||
}
|
||||
@@ -2417,6 +2417,11 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest {
|
||||
runTest("compiler/testData/diagnostics/tests/callableReference/property/extensionPropertyOnNullable.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("extensionsSameName.kt")
|
||||
public void testExtensionsSameName() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/callableReference/property/extensionsSameName.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("genericClass.kt")
|
||||
public void testGenericClass() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/callableReference/property/genericClass.kt");
|
||||
|
||||
Generated
+5
@@ -2412,6 +2412,11 @@ public class DiagnosticsUsingJavacTestGenerated extends AbstractDiagnosticsUsing
|
||||
runTest("compiler/testData/diagnostics/tests/callableReference/property/extensionPropertyOnNullable.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("extensionsSameName.kt")
|
||||
public void testExtensionsSameName() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/callableReference/property/extensionsSameName.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("genericClass.kt")
|
||||
public void testGenericClass() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/callableReference/property/genericClass.kt");
|
||||
|
||||
Reference in New Issue
Block a user