Modify top-level/extension property hierarchy

- rename KTopLevelProperty to KTopLevelVariable
- create KTopLevelExtensionProperty, a subclass of KExtensionProperty
- create KTopLevelProperty, a superclass of KTopLevelVariable and
  KTopLevelExtensionProperty. (In the future, it will have a container of type
  KPackage.)
This commit is contained in:
Alexander Udalov
2014-07-01 17:12:47 +04:00
parent f73b8b9ff8
commit d32a02f21a
11 changed files with 83 additions and 35 deletions
@@ -8,6 +8,7 @@ var Int.meaning: Long
fun test() {
val f = String::countCharacters
f : KTopLevelExtensionProperty<String, Int>
f : KExtensionProperty<String, Int>
<!TYPE_MISMATCH!>f<!> : KMutableExtensionProperty<String, Int>
f.get("abc") : Int
@@ -15,7 +16,9 @@ fun test() {
val g = Int::meaning
g : KTopLevelExtensionProperty<Int, Long>
g : KExtensionProperty<Int, Long>
g : KMutableTopLevelExtensionProperty<Int, Long>
g : KMutableExtensionProperty<Int, Long>
g.get(0) : Long
g.set(1, 0L)
@@ -4,8 +4,11 @@ val y: String get() = "y"
fun testX() {
val xx = ::x
xx : KMutableTopLevelProperty<Int>
xx : KMutableTopLevelVariable<Int>
xx : KTopLevelProperty<Int>
xx : KTopLevelVariable<Int>
xx : KMutableProperty<Int>
xx : KMutableVariable<Int>
xx : KProperty<Int>
xx : KCallable<Int>
@@ -17,7 +20,7 @@ fun testX() {
fun testY() {
val yy = ::y
<!TYPE_MISMATCH!>yy<!> : KMutableTopLevelProperty<String>
yy : KTopLevelProperty<String>
yy : KTopLevelVariable<String>
<!TYPE_MISMATCH!>yy<!> : KMutableProperty<String>
yy : KProperty<String>
yy : KCallable<String>