[NI] Consider synthetic lower nullability constraint non-proper
This commit is contained in:
Generated
+5
@@ -10808,6 +10808,11 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirOldFronte
|
||||
runTest("compiler/testData/diagnostics/tests/inference/nothingType/nestedLambdaInferenceWithIncorporationOfVariables.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("notEnoughInformationFromNullabilityConstraint.kt")
|
||||
public void testNotEnoughInformationFromNullabilityConstraint() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/inference/nothingType/notEnoughInformationFromNullabilityConstraint.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("nothingWithCallableReference.kt")
|
||||
public void testNothingWithCallableReference() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/inference/nothingType/nothingWithCallableReference.kt");
|
||||
|
||||
+3
-1
@@ -131,7 +131,9 @@ class VariableFixationFinder(
|
||||
notFixedTypeVariables[variable]?.constraints?.any { isProperArgumentConstraint(it) } ?: false
|
||||
|
||||
private fun Context.isProperArgumentConstraint(c: Constraint) =
|
||||
isProperType(c.type) && c.position.initialConstraint.position !is DeclaredUpperBoundConstraintPosition
|
||||
isProperType(c.type)
|
||||
&& c.position.initialConstraint.position !is DeclaredUpperBoundConstraintPosition
|
||||
&& !c.isNullabilityConstraint
|
||||
|
||||
private fun Context.isProperType(type: KotlinTypeMarker): Boolean =
|
||||
!type.contains { notFixedTypeVariables.containsKey(it.typeConstructor()) }
|
||||
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// !LANGUAGE: +NewInference
|
||||
// !WITH_NEW_INFERENCE
|
||||
|
||||
fun <M> make(): M? = null
|
||||
fun <I> id(arg: I): I = arg
|
||||
|
||||
val v = id(
|
||||
make()
|
||||
)
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// !LANGUAGE: +NewInference
|
||||
// !WITH_NEW_INFERENCE
|
||||
|
||||
fun <M> make(): M? = null
|
||||
fun <I> id(arg: I): I = arg
|
||||
|
||||
val v = <!NI;NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, OI;TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>id<!>(
|
||||
<!NI;NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, OI;TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>make<!>()
|
||||
)
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
package
|
||||
|
||||
public val v: [ERROR : Type for id(
|
||||
make()
|
||||
)]
|
||||
public fun </*0*/ I> id(/*0*/ arg: I): I
|
||||
public fun </*0*/ M> make(): M?
|
||||
@@ -10815,6 +10815,11 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest {
|
||||
runTest("compiler/testData/diagnostics/tests/inference/nothingType/nestedLambdaInferenceWithIncorporationOfVariables.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("notEnoughInformationFromNullabilityConstraint.kt")
|
||||
public void testNotEnoughInformationFromNullabilityConstraint() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/inference/nothingType/notEnoughInformationFromNullabilityConstraint.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("nothingWithCallableReference.kt")
|
||||
public void testNothingWithCallableReference() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/inference/nothingType/nothingWithCallableReference.kt");
|
||||
|
||||
Generated
+5
@@ -10810,6 +10810,11 @@ public class DiagnosticsUsingJavacTestGenerated extends AbstractDiagnosticsUsing
|
||||
runTest("compiler/testData/diagnostics/tests/inference/nothingType/nestedLambdaInferenceWithIncorporationOfVariables.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("notEnoughInformationFromNullabilityConstraint.kt")
|
||||
public void testNotEnoughInformationFromNullabilityConstraint() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/inference/nothingType/notEnoughInformationFromNullabilityConstraint.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("nothingWithCallableReference.kt")
|
||||
public void testNothingWithCallableReference() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/inference/nothingType/nothingWithCallableReference.kt");
|
||||
|
||||
Reference in New Issue
Block a user