FIR: Prohibit calling singletons' constructors

This commit is contained in:
Denis Zharkov
2020-04-17 10:56:36 +03:00
parent b62400124a
commit 7612f37c85
6 changed files with 118 additions and 4 deletions
@@ -0,0 +1,31 @@
class A {
companion object Comp {}
fun foo() {
<!INAPPLICABLE_CANDIDATE!>Comp<!>()
}
}
object B {
private val x = <!INAPPLICABLE_CANDIDATE!>B<!>()
}
class D {
companion object Comp2 {
operator fun invoke() {}
}
fun foo() {
Comp2()
}
}
enum class E {
X {
};
fun foo() {
<!UNRESOLVED_REFERENCE!>X<!>()
}
}