Remove default import "kotlin.reflect"

Basic reflection is usable without any imports (with :: literals)

This reverts commit 9503056dd5.
This commit is contained in:
Alexander Udalov
2014-07-01 17:42:35 +04:00
parent d32a02f21a
commit a38a396a43
67 changed files with 122 additions and 4 deletions
@@ -1,3 +1,5 @@
import kotlin.reflect.KFunction0
class A {
fun main() {
val x = ::A
@@ -1,3 +1,5 @@
import kotlin.reflect.KFunction0
class A
class B
@@ -1,3 +1,5 @@
import kotlin.reflect.KFunction0
class A
class B {
@@ -1,3 +1,5 @@
import kotlin.reflect.KFunction0
class A
fun main() {
@@ -12,6 +12,8 @@ class A {
package other
import kotlin.reflect.*
import first.A
fun main() {
@@ -12,6 +12,8 @@ fun A.baz() {}
package other
import kotlin.reflect.KExtensionFunction0
import first.A
import first.foo
@@ -10,6 +10,8 @@ fun baz() = "OK"
package other
import kotlin.reflect.*
import first.foo
import first.bar
import first.baz
@@ -1,3 +1,5 @@
import kotlin.reflect.*
class A {
fun main() {
val x = ::foo
@@ -1,3 +1,5 @@
import kotlin.reflect.*
class A
fun A.main() {
@@ -1,3 +1,5 @@
import kotlin.reflect.*
class B
class A {
@@ -1,3 +1,5 @@
import kotlin.reflect.*
class A
fun A.foo() {}
@@ -1,3 +1,5 @@
import kotlin.reflect.*
class A {
fun foo() {}
}
@@ -1,3 +1,5 @@
import kotlin.reflect.KMemberFunction0
class A<T>(val t: T) {
fun foo(): T = t
}
@@ -1,3 +1,5 @@
import kotlin.reflect.KMemberFunction0
class A {
inner class Inner
@@ -1,3 +1,5 @@
import kotlin.reflect.KMemberFunction0
class A {
inner class Inner
}
@@ -1,3 +1,5 @@
import kotlin.reflect.KMemberFunction0
class A {
inner class Inner
}
@@ -1,3 +1,5 @@
import kotlin.reflect.KFunction0
fun main() {
class A
@@ -1,3 +1,5 @@
import kotlin.reflect.KFunction0
fun main() {
class A
@@ -1,3 +1,5 @@
import kotlin.reflect.KFunction0
fun main() {
class A
@@ -1,3 +1,5 @@
import kotlin.reflect.KFunction0
fun main() {
class A
@@ -1,3 +1,5 @@
import kotlin.reflect.*
fun main() {
fun foo() {}
fun bar(<!UNUSED_PARAMETER!>x<!>: Int) {}
@@ -1,3 +1,5 @@
import kotlin.reflect.*
class A
fun main() {
@@ -1,3 +1,5 @@
import kotlin.reflect.*
fun main() {
fun foo() {}
fun bar(<!UNUSED_PARAMETER!>x<!>: Int) {}
@@ -1,3 +1,5 @@
import kotlin.reflect.*
class A
fun main() {
@@ -8,6 +8,8 @@ class D {
// FILE: b.kt
import kotlin.reflect.KMemberFunction0
fun main() {
val x = a.b.c.D::foo
@@ -8,6 +8,8 @@ class D<E, F> {
// FILE: b.kt
import kotlin.reflect.KMemberFunction2
fun main() {
val x = a.b.c.D<String, Int>::foo
@@ -1,3 +1,5 @@
import kotlin.reflect.*
class A {
fun foo() {}
fun bar(<!UNUSED_PARAMETER!>x<!>: Int) {}
@@ -1,3 +1,5 @@
import kotlin.reflect.*
class A {
fun foo() {}
fun bar(<!UNUSED_PARAMETER!>x<!>: Int) {}
@@ -1,3 +1,5 @@
import kotlin.reflect.*
class A {
fun foo() {}
fun bar(<!UNUSED_PARAMETER!>x<!>: Int) {}
@@ -1,3 +1,5 @@
import kotlin.reflect.*
class A {
fun foo() {}
fun bar(<!UNUSED_PARAMETER!>x<!>: Int) {}
@@ -1,3 +1,5 @@
import kotlin.reflect.KFunction0
class A {
class Nested
@@ -1,3 +1,5 @@
import kotlin.reflect.KFunction0
class A {
class Nested
}
@@ -1,3 +1,5 @@
import kotlin.reflect.KFunction0
class A {
class Nested
}
@@ -1,3 +1,5 @@
import kotlin.reflect.KMemberFunction0
class A {
fun foo() = 42
}
@@ -1,3 +1,5 @@
import kotlin.reflect.KMemberFunction0
fun foo() {}
class A {
@@ -12,6 +12,8 @@ fun A.baz(<!UNUSED_PARAMETER!>x<!>: String) {}
// FILE: b.kt
import kotlin.reflect.*
import other.foo as foofoo
import other.A as AA
import other.baz as bazbaz
@@ -1,3 +1,5 @@
import kotlin.reflect.*
fun foo() {}
fun bar(<!UNUSED_PARAMETER!>x<!>: Int) {}
fun baz() = "OK"
@@ -1,3 +1,5 @@
import kotlin.reflect.*
class A
fun foo() {}
@@ -1,3 +1,5 @@
import kotlin.reflect.*
class A
fun foo() {}
@@ -1,3 +1,5 @@
import kotlin.reflect.*
fun foo() {}
fun bar(<!UNUSED_PARAMETER!>x<!>: Int) {}
fun baz() = "OK"
@@ -1,3 +1,5 @@
import kotlin.reflect.KMemberProperty
trait Base {
val x: Any
}
@@ -1,3 +1,5 @@
import kotlin.reflect.KMemberProperty
open class Base {
val foo: Int = 42
}
@@ -1,3 +1,5 @@
import kotlin.reflect.*
class A(var g: A) {
val f: Int = 0
@@ -1,3 +1,5 @@
import kotlin.reflect.*
class A {
fun test() {
::foo : KExtensionProperty<A, String>
@@ -1,3 +1,5 @@
import kotlin.reflect.*
val String.countCharacters: Int
get() = length
@@ -1,3 +1,5 @@
import kotlin.reflect.KMemberProperty
class A<T>(val t: T) {
val foo: T = t
}
@@ -13,6 +13,8 @@ public class JavaClass {
// FILE: test.kt
import kotlin.reflect.*
fun test() {
JavaClass::publicFinal : KMemberProperty<JavaClass, Int>
JavaClass::publicMutable : KMutableMemberProperty<JavaClass, Long>
@@ -15,6 +15,8 @@ public class JavaClass {
import JavaClass.*
import kotlin.reflect.*
fun test() {
::publicFinal : KTopLevelProperty<String>
::publicMutable : KMutableTopLevelProperty<Any?>
@@ -1,3 +1,5 @@
import kotlin.reflect.*
class A {
val foo: Unit = Unit.VALUE
var bar: String = ""
@@ -1,3 +1,5 @@
import kotlin.reflect.*
class A {
val foo: Int = 42
var bar: String = ""
@@ -1,3 +1,5 @@
import kotlin.reflect.*
var x: Int = 42
val y: String get() = "y"