FE: add test for KT-54305
This commit is contained in:
committed by
Space Team
parent
9f3d8130db
commit
7bd512fbb3
+6
@@ -801,6 +801,12 @@ public class DiagnosisCompilerTestFE10TestdataTestGenerated extends AbstractDiag
|
||||
runTest("compiler/testData/diagnostics/tests/SyntaxErrorInTestHighlightingEof.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("syntheticSet.kt")
|
||||
public void testSyntheticSet() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/syntheticSet.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("tailRecBasic.kt")
|
||||
public void testTailRecBasic() throws Exception {
|
||||
|
||||
+6
@@ -801,6 +801,12 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti
|
||||
runTest("compiler/testData/diagnostics/tests/SyntaxErrorInTestHighlightingEof.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("syntheticSet.kt")
|
||||
public void testSyntheticSet() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/syntheticSet.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("tailRecBasic.kt")
|
||||
public void testTailRecBasic() throws Exception {
|
||||
|
||||
+6
@@ -801,6 +801,12 @@ public class FirOldFrontendDiagnosticsWithLightTreeTestGenerated extends Abstrac
|
||||
runTest("compiler/testData/diagnostics/tests/SyntaxErrorInTestHighlightingEof.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("syntheticSet.kt")
|
||||
public void testSyntheticSet() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/syntheticSet.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("tailRecBasic.kt")
|
||||
public void testTailRecBasic() throws Exception {
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
// FILE: Container.java
|
||||
|
||||
public class Container<E> {
|
||||
|
||||
Wrapper<E> w = null;
|
||||
|
||||
public Wrapper<E> getWrapper() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public void setWrapper(Wrapper<E> wrapper) {}
|
||||
}
|
||||
|
||||
// FILE: Wrapper.java
|
||||
|
||||
public class Wrapper<W> {
|
||||
}
|
||||
|
||||
// FILE: test.kt
|
||||
|
||||
fun foo(container: Container<*>, wrapper: Wrapper<String>) {
|
||||
container.w = <!ASSIGNMENT_TYPE_MISMATCH!>wrapper<!>
|
||||
container.wrapper = <!ASSIGNMENT_TYPE_MISMATCH!>wrapper<!>
|
||||
container.setWrapper(<!ARGUMENT_TYPE_MISMATCH!>wrapper<!>)
|
||||
}
|
||||
|
||||
fun bar(container: Container<String>, wrapper: Wrapper<String>) {
|
||||
container.wrapper = wrapper
|
||||
container.setWrapper(wrapper)
|
||||
}
|
||||
|
||||
fun baz(container: Container<Any>, wrapper: Wrapper<String>) {
|
||||
container.wrapper = <!ASSIGNMENT_TYPE_MISMATCH!>wrapper<!>
|
||||
}
|
||||
|
||||
fun gau(container: Container<String>, wrapper: Wrapper<Any>) {
|
||||
container.wrapper = <!ASSIGNMENT_TYPE_MISMATCH!>wrapper<!>
|
||||
}
|
||||
|
||||
fun dif(container: Container<String>, wrapper: Wrapper<Int>) {
|
||||
container.wrapper = <!ASSIGNMENT_TYPE_MISMATCH!>wrapper<!>
|
||||
}
|
||||
|
||||
fun out(container: Container<out Any>, wrapper: Wrapper<String>) {
|
||||
container.wrapper = <!ASSIGNMENT_TYPE_MISMATCH!>wrapper<!>
|
||||
container.setWrapper(<!ARGUMENT_TYPE_MISMATCH!>wrapper<!>)
|
||||
}
|
||||
|
||||
fun inn(container: Container<in String>, wrapper: Wrapper<Any>) {
|
||||
container.wrapper = <!ASSIGNMENT_TYPE_MISMATCH!>wrapper<!>
|
||||
container.setWrapper(<!ARGUMENT_TYPE_MISMATCH!>wrapper<!>)
|
||||
}
|
||||
|
||||
fun <T> generic(container: Container<out T>, wrapper: Wrapper<out T>) {
|
||||
container.wrapper = <!ASSIGNMENT_TYPE_MISMATCH!>wrapper<!>
|
||||
container.setWrapper(<!ARGUMENT_TYPE_MISMATCH!>wrapper<!>)
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
// FILE: Container.java
|
||||
|
||||
public class Container<E> {
|
||||
|
||||
Wrapper<E> w = null;
|
||||
|
||||
public Wrapper<E> getWrapper() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public void setWrapper(Wrapper<E> wrapper) {}
|
||||
}
|
||||
|
||||
// FILE: Wrapper.java
|
||||
|
||||
public class Wrapper<W> {
|
||||
}
|
||||
|
||||
// FILE: test.kt
|
||||
|
||||
fun foo(container: Container<*>, wrapper: Wrapper<String>) {
|
||||
container.w = <!TYPE_MISMATCH!>wrapper<!>
|
||||
container.wrapper = wrapper
|
||||
container.setWrapper(<!TYPE_MISMATCH!>wrapper<!>)
|
||||
}
|
||||
|
||||
fun bar(container: Container<String>, wrapper: Wrapper<String>) {
|
||||
container.wrapper = wrapper
|
||||
container.setWrapper(wrapper)
|
||||
}
|
||||
|
||||
fun baz(container: Container<Any>, wrapper: Wrapper<String>) {
|
||||
container.wrapper = <!TYPE_MISMATCH!>wrapper<!>
|
||||
}
|
||||
|
||||
fun gau(container: Container<String>, wrapper: Wrapper<Any>) {
|
||||
container.wrapper = <!TYPE_MISMATCH!>wrapper<!>
|
||||
}
|
||||
|
||||
fun dif(container: Container<String>, wrapper: Wrapper<Int>) {
|
||||
container.wrapper = <!TYPE_MISMATCH!>wrapper<!>
|
||||
}
|
||||
|
||||
fun out(container: Container<out Any>, wrapper: Wrapper<String>) {
|
||||
container.wrapper = wrapper
|
||||
container.setWrapper(<!TYPE_MISMATCH!>wrapper<!>)
|
||||
}
|
||||
|
||||
fun inn(container: Container<in String>, wrapper: Wrapper<Any>) {
|
||||
container.wrapper = wrapper
|
||||
container.setWrapper(<!TYPE_MISMATCH!>wrapper<!>)
|
||||
}
|
||||
|
||||
fun <T> generic(container: Container<out T>, wrapper: Wrapper<out T>) {
|
||||
container.wrapper = wrapper
|
||||
container.setWrapper(<!TYPE_MISMATCH!>wrapper<!>)
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package
|
||||
|
||||
public fun bar(/*0*/ container: Container<kotlin.String>, /*1*/ wrapper: Wrapper<kotlin.String>): kotlin.Unit
|
||||
public fun baz(/*0*/ container: Container<kotlin.Any>, /*1*/ wrapper: Wrapper<kotlin.String>): kotlin.Unit
|
||||
public fun dif(/*0*/ container: Container<kotlin.String>, /*1*/ wrapper: Wrapper<kotlin.Int>): kotlin.Unit
|
||||
public fun foo(/*0*/ container: Container<*>, /*1*/ wrapper: Wrapper<kotlin.String>): kotlin.Unit
|
||||
public fun gau(/*0*/ container: Container<kotlin.String>, /*1*/ wrapper: Wrapper<kotlin.Any>): kotlin.Unit
|
||||
public fun </*0*/ T> generic(/*0*/ container: Container<out T>, /*1*/ wrapper: Wrapper<out T>): kotlin.Unit
|
||||
public fun inn(/*0*/ container: Container<in kotlin.String>, /*1*/ wrapper: Wrapper<kotlin.Any>): kotlin.Unit
|
||||
public fun out(/*0*/ container: Container<out kotlin.Any>, /*1*/ wrapper: Wrapper<kotlin.String>): kotlin.Unit
|
||||
|
||||
public open class Container</*0*/ E : kotlin.Any!> {
|
||||
public constructor Container</*0*/ E : kotlin.Any!>()
|
||||
public/*package*/ final var w: Wrapper<E!>!
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open fun getWrapper(): Wrapper<E!>!
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open fun setWrapper(/*0*/ wrapper: Wrapper<E!>!): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public open class Wrapper</*0*/ W : kotlin.Any!> {
|
||||
public constructor Wrapper</*0*/ W : kotlin.Any!>()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
Generated
+6
@@ -801,6 +801,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
|
||||
runTest("compiler/testData/diagnostics/tests/SyntaxErrorInTestHighlightingEof.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("syntheticSet.kt")
|
||||
public void testSyntheticSet() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/syntheticSet.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("tailRecBasic.kt")
|
||||
public void testTailRecBasic() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user