[FIR TEST] Add some FIR_IDENTICAL to fix recently changed tests

This commit is contained in:
Mikhail Glukhikh
2020-09-21 16:19:54 +03:00
parent c9054e7a04
commit a9972913a6
14 changed files with 7 additions and 163 deletions
@@ -1,15 +0,0 @@
// !LANGUAGE: +ProhibitVisibilityOfNestedClassifiersFromSupertypesOfCompanion
// see https://youtrack.jetbrains.com/issue/KT-21515
open class Container {
open class Base {
open fun m() {}
}
// note that Base() supertype will be resolved in scope that was created on recursion
abstract class DerivedAbstract : Base()
companion object : DerivedAbstract() {
override fun m() {}
}
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !LANGUAGE: +ProhibitVisibilityOfNestedClassifiersFromSupertypesOfCompanion
// see https://youtrack.jetbrains.com/issue/KT-21515
@@ -1,15 +0,0 @@
// !LANGUAGE: +ProhibitVisibilityOfNestedClassifiersFromSupertypesOfCompanion
// see https://youtrack.jetbrains.com/issue/KT-21515
abstract class DerivedAbstract : C.Base() {
open class Data
}
public class C {
open class Base ()
class Foo : <!UNRESOLVED_REFERENCE!>Data<!>()
companion object : DerivedAbstract()
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !LANGUAGE: +ProhibitVisibilityOfNestedClassifiersFromSupertypesOfCompanion
// see https://youtrack.jetbrains.com/issue/KT-21515
@@ -1,18 +0,0 @@
// !LANGUAGE: +ProhibitVisibilityOfNestedClassifiersFromSupertypesOfCompanion
// see https://youtrack.jetbrains.com/issue/KT-21515
open class Container {
// Note that here we also have errors and diagnostics, even though there are actually no loops.
// (this is case because we can't know if there are any loops without resolving, but resolving
// itself provokes loops)
interface Base {
open fun m() {}
}
interface DerivedAbstract : Base
companion object : DerivedAbstract {
override fun m() {}
}
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !LANGUAGE: +ProhibitVisibilityOfNestedClassifiersFromSupertypesOfCompanion
// see https://youtrack.jetbrains.com/issue/KT-21515
@@ -1,20 +0,0 @@
// see https://youtrack.jetbrains.com/issue/KT-21515
abstract class DerivedAbstract : C.Base() {
override abstract fun m()
}
public class C {
class Data
open class Base () {
open fun m() {}
}
// Note that Data is resolved successfully here because we don't step on error-scope
val data: Data = Data()
companion object : DerivedAbstract() {
override fun m() {}
}
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// see https://youtrack.jetbrains.com/issue/KT-21515
abstract class DerivedAbstract : C.Base() {
@@ -1,20 +0,0 @@
// !LANGUAGE: +ProhibitVisibilityOfNestedClassifiersFromSupertypesOfCompanion
// see https://youtrack.jetbrains.com/issue/KT-21515
interface SomeIrrelevantInterface
// note that C.Base() supertype will be resolved in normal scope
abstract class DerivedAbstract : C.Base()
class Data
public class C {
val data: Data = Data()
// Note that any supertype of Base will be resolved in error-scope, even if it absolutely irrelevant
// to the types in cycle.
open class Base() : SomeIrrelevantInterface
companion object : DerivedAbstract()
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !LANGUAGE: +ProhibitVisibilityOfNestedClassifiersFromSupertypesOfCompanion
// see https://youtrack.jetbrains.com/issue/KT-21515
@@ -1,58 +0,0 @@
// !LANGUAGE: +ProhibitVisibilityOfNestedClassifiersFromSupertypesOfCompanion
// see https://youtrack.jetbrains.com/issue/KT-21515
object WithFunctionInBase {
abstract class DerivedAbstract : C.Base()
class Data
public class C {
val data: Data = Data()
open class Base() {
fun foo(): Int = 42
}
companion object : DerivedAbstract()
}
}
object WithPropertyInBase {
// This case is very similar to previous one, but there are subtle differences from POV of implementation
abstract class DerivedAbstract : C.Base()
class Data
public class C {
open class Base() {
val foo: Int = 42
}
val data: Data = Data()
companion object : DerivedAbstract()
}
}
object WithPropertyInBaseDifferentOrder {
// This case is very similar to previous one, but there are subtle differences from POV of implementation
// Note how position of property in file affected order of resolve, and, consequently, its results and
// diagnostics.
abstract class DerivedAbstract : C.Base()
class Data
public class C {
val data: Data = Data()
open class Base() {
val foo: Int = 42
}
companion object : DerivedAbstract()
}
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !LANGUAGE: +ProhibitVisibilityOfNestedClassifiersFromSupertypesOfCompanion
// see https://youtrack.jetbrains.com/issue/KT-21515
@@ -1,17 +0,0 @@
// see https://youtrack.jetbrains.com/issue/KT-21515
abstract class DerivedAbstract : C.Base()
class Data
open class C {
open class Base {
open fun m() {}
}
val field = Data()
companion object : DerivedAbstract() {
override fun m() {}
}
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// see https://youtrack.jetbrains.com/issue/KT-21515
abstract class DerivedAbstract : C.Base()