Introduce FIR_IDENTICAL for FIR vs old frontend tests #KT-36879 Fixed

This commit is contained in:
Mikhail Glukhikh
2020-03-04 17:54:33 +03:00
parent 186e0b0cba
commit 8884cbe415
2268 changed files with 1175 additions and 19754 deletions
@@ -1,6 +0,0 @@
interface My
internal class Your: My
// Code is valid, despite of delegate is internal
class His: My by Your()
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
interface My
internal class Your: My
@@ -1,4 +0,0 @@
private interface My
// valid, it's allowed to implement worse-visible interface
class Your: My
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
private interface My
// valid, it's allowed to implement worse-visible interface
@@ -1,10 +0,0 @@
public open class A {
protected open class B
}
public open class C : A() {
protected open class D {
// internal & protected(in C) <= protected(in A): Ok
internal open class E : A.B()
}
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
public open class A {
protected open class B
}
@@ -1,7 +0,0 @@
class My {
internal open class ThreadLocal
// Private from local: ???
private val values =
// Local from internal: Ok
object: ThreadLocal() {}
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
class My {
internal open class ThreadLocal
// Private from local: ???
@@ -1,15 +0,0 @@
class A {
private open class B
fun f() {
// Local from private: Ok
class C : B()
}
}
private open class D
fun f(): Int {
// Local from private: Ok
val x = object : D() { }
return x.hashCode()
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
class A {
private open class B
fun f() {
@@ -1,6 +0,0 @@
internal open class My
internal class Outer {
// Ok, effectively internal from internal
class Your: My()
}
+1
View File
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
internal open class My
internal class Outer {
@@ -1,12 +0,0 @@
interface Your
class My {
// private from local: ???
private val x = object : Your {}
// private from local: ???
private fun foo() = {
class Local
Local()
}()
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
interface Your
class My {
@@ -1,3 +0,0 @@
private enum class Foo { A, B }
class Bar private constructor(private val foo: Foo)
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
private enum class Foo { A, B }
class Bar private constructor(private val foo: Foo)
@@ -1,3 +0,0 @@
private enum class Foo { A, B }
private class Bar(val foo: Foo)
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
private enum class Foo { A, B }
private class Bar(val foo: Foo)
@@ -1,16 +0,0 @@
// FILE: Outer.java
public abstract class Outer {
protected static class My {}
protected static class Your extends My {}
abstract protected Your foo(My my);
}
// FILE: OuterDerived.kt
class OuterDerived: Outer() {
// valid, My has better visibility
protected class His: Outer.My()
// valid, My and Your have better visibility
override fun foo(my: Outer.My) = Outer.Your()
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// FILE: Outer.java
public abstract class Outer {
@@ -1,13 +0,0 @@
abstract class Outer {
protected open class My
// Both valid: same way protected
protected class Your: My()
abstract protected fun foo(my: My): Your
}
class OuterDerived: Outer() {
// valid, My has better visibility
protected class His: Outer.My()
// valid, My and Your have better visibility
override fun foo(my: Outer.My) = Outer.Your()
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
abstract class Outer {
protected open class My
// Both valid: same way protected