Allow to use "static" part of class in own constructors by short name, including in primary constructor

This commit is contained in:
Zalim Bashorov
2015-12-08 20:57:45 +03:00
parent f319b1b93a
commit 5bf8b4d946
30 changed files with 1017 additions and 25 deletions
@@ -0,0 +1,48 @@
// !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(),
<!UNRESOLVED_REFERENCE!>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!!
}
}