Files
kotlin-fork/compiler/testData/diagnostics/tests/resolve/constructorVsCompanion.kt
T
Dmitry Petrov 7b432c878a Diagnostics improvements for corner cases
(class/package qualifier in non-qualifier position).
2015-11-18 16:27:21 +03:00

23 lines
410 B
Kotlin
Vendored

class A private constructor()
class B {
private companion object
}
class C(val x: Int)
class D private constructor() {
companion object
}
class E private constructor() {
companion object {
operator fun invoke(x: Int) = x
}
}
val a = <!NO_COMPANION_OBJECT!>A<!>
<!EXPOSED_PROPERTY_TYPE!>val b = <!INVISIBLE_MEMBER!>B<!><!>
val c = <!NO_COMPANION_OBJECT!>C<!>
val d = D
val e = E(42)