Files
kotlin-fork/compiler/testData/diagnostics/tests/scopes/classHeader/superConstructorArguments.kt
T
Denis Zharkov a7fc32c8da Add diagnostic on calling inner classes constructors without receiver
Otherwise there will be just an unresolved reference that doesn't give
any useful information

 #KT-8959 Fixed
2017-03-01 09:59:01 +03:00

49 lines
791 B
Kotlin
Vendored

// !DIAGNOSTICS: -UNUSED_PARAMETER
open class S(
n: A.Nested,
n2: A.Nested,
inn: A.Inner,
c: Int,
cc: Int,
cn: Int,
ci: Int,
t1: Int,
t2: Int
)
class A : S (
foo(),
Nested(),
<!RESOLUTION_TO_CLASSIFIER!>Inner<!>(),
CONST,
Companion.CONST,
Nested.CONST,
Interface.CONST,
<!UNRESOLVED_REFERENCE!>a<!>,
<!UNRESOLVED_REFERENCE!>b<!>()
) {
class Nested {
companion object {
const val CONST = 2
}
}
inner class Inner
interface Interface {
companion object {
const val CONST = 3
}
}
val a = 1
fun b() = 2
companion object {
const val CONST = 1
fun foo(): Nested = null!!
}
}