FIR: Use Any? expect type to the argument list of ==
^KT-47409 Related
This commit is contained in:
committed by
TeamCityServer
parent
4892ad42b9
commit
c8c558b575
+5
@@ -2421,6 +2421,11 @@ public class LazyBodyIsNotTouchedTilContractsPhaseTestGenerated extends Abstract
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/inference/elvisAndUnit.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("equals.kt")
|
||||
public void testEquals() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/inference/equals.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("extensionCallableReferences.kt")
|
||||
public void testExtensionCallableReferences() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/inference/extensionCallableReferences.kt");
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
FILE: equals.kt
|
||||
public final fun <T> materialize(): R|T| {
|
||||
^materialize R|kotlin/TODO|()
|
||||
}
|
||||
public final fun main(): R|kotlin/Unit| {
|
||||
when () {
|
||||
==(String(), R|/materialize|<R|kotlin/Any?|>()) -> {
|
||||
^main Unit
|
||||
}
|
||||
}
|
||||
|
||||
when () {
|
||||
==(R|/materialize|<R|kotlin/Any?|>(), String()) -> {
|
||||
^main Unit
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
fun <T> materialize(): T = TODO()
|
||||
|
||||
fun main() {
|
||||
if ("" == materialize()) return // FE1.0: OK, type argument inferred to Any?
|
||||
if (materialize() == "") return // FE1.0: Error, uninferred type argument for `T`
|
||||
}
|
||||
+6
@@ -2751,6 +2751,12 @@ public class FirDiagnosticTestGenerated extends AbstractFirDiagnosticTest {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/inference/elvisAndUnit.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("equals.kt")
|
||||
public void testEquals() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/inference/equals.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("extensionCallableReferences.kt")
|
||||
public void testExtensionCallableReferences() throws Exception {
|
||||
|
||||
+6
@@ -2751,6 +2751,12 @@ public class FirDiagnosticsWithLightTreeTestGenerated extends AbstractFirDiagnos
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/inference/elvisAndUnit.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("equals.kt")
|
||||
public void testEquals() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/inference/equals.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("extensionCallableReferences.kt")
|
||||
public void testExtensionCallableReferences() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user