[NI] Add test to check how behavior will be changed after few commits

This commit is contained in:
Mikhail Zarechenskiy
2020-02-20 02:49:48 +03:00
parent 0e970407a4
commit 162a2d5851
6 changed files with 53 additions and 0 deletions
@@ -21215,6 +21215,11 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirOldFronte
public void testSmartCastOnReceiver() throws Exception {
runTest("compiler/testData/diagnostics/tests/smartCasts/inference/smartCastOnReceiver.kt");
}
@TestMetadata("stabilityOfSmartcastsAgainstGenericFunctions.kt")
public void testStabilityOfSmartcastsAgainstGenericFunctions() throws Exception {
runTest("compiler/testData/diagnostics/tests/smartCasts/inference/stabilityOfSmartcastsAgainstGenericFunctions.kt");
}
}
@TestMetadata("compiler/testData/diagnostics/tests/smartCasts/intersectionScope")
@@ -0,0 +1,13 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_LAMBDA_EXPRESSION -VARIABLE_WITH_REDUNDANT_INITIALIZER -UNUSED_EXPRESSION
object Test {
fun <T> foo(actual: T) {}
fun <T : Number> foo(actual: T) {}
}
fun main() {
var y: Number? = null
y = 2
{ y = 1 }
Test.foo(y)
}
@@ -0,0 +1,13 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_LAMBDA_EXPRESSION -VARIABLE_WITH_REDUNDANT_INITIALIZER -UNUSED_EXPRESSION
object Test {
fun <T> foo(actual: T) {}
fun <T : Number> foo(actual: T) {}
}
fun main() {
var y: Number? = null
y = 2
{ y = 1 }
Test.foo(<!SMARTCAST_IMPOSSIBLE, SMARTCAST_IMPOSSIBLE!>y<!>)
}
@@ -0,0 +1,12 @@
package
public fun main(): kotlin.Unit
public object Test {
private constructor Test()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public final fun </*0*/ T> foo(/*0*/ actual: T): kotlin.Unit
public final fun </*0*/ T : kotlin.Number> foo(/*0*/ actual: T): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
@@ -21292,6 +21292,11 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest {
public void testSmartCastOnReceiver() throws Exception {
runTest("compiler/testData/diagnostics/tests/smartCasts/inference/smartCastOnReceiver.kt");
}
@TestMetadata("stabilityOfSmartcastsAgainstGenericFunctions.kt")
public void testStabilityOfSmartcastsAgainstGenericFunctions() throws Exception {
runTest("compiler/testData/diagnostics/tests/smartCasts/inference/stabilityOfSmartcastsAgainstGenericFunctions.kt");
}
}
@TestMetadata("compiler/testData/diagnostics/tests/smartCasts/intersectionScope")
@@ -21217,6 +21217,11 @@ public class DiagnosticsUsingJavacTestGenerated extends AbstractDiagnosticsUsing
public void testSmartCastOnReceiver() throws Exception {
runTest("compiler/testData/diagnostics/tests/smartCasts/inference/smartCastOnReceiver.kt");
}
@TestMetadata("stabilityOfSmartcastsAgainstGenericFunctions.kt")
public void testStabilityOfSmartcastsAgainstGenericFunctions() throws Exception {
runTest("compiler/testData/diagnostics/tests/smartCasts/inference/stabilityOfSmartcastsAgainstGenericFunctions.kt");
}
}
@TestMetadata("compiler/testData/diagnostics/tests/smartCasts/intersectionScope")