Move callable reference diagnostic tests to non-stdlib
This commit is contained in:
+12
@@ -0,0 +1,12 @@
|
||||
// !DIAGNOSTICS: -UNUSED_EXPRESSION
|
||||
interface A
|
||||
abstract class B
|
||||
annotation class C
|
||||
enum class D
|
||||
|
||||
fun main() {
|
||||
::<!UNRESOLVED_REFERENCE!>A<!>
|
||||
::<!CREATING_AN_INSTANCE_OF_ABSTRACT_CLASS!>B<!>
|
||||
::C // KT-3465
|
||||
::<!INVISIBLE_MEMBER!>D<!>
|
||||
}
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
package
|
||||
|
||||
internal fun main(): kotlin.Unit
|
||||
|
||||
internal interface A {
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
internal abstract class B {
|
||||
public constructor B()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
internal final annotation class C : kotlin.Annotation {
|
||||
public constructor C()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
internal final enum class D : kotlin.Enum<D> {
|
||||
private constructor D()
|
||||
public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: D): kotlin.Int
|
||||
public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public final override /*1*/ /*fake_override*/ fun name(): kotlin.String
|
||||
public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
// Static members
|
||||
public final /*synthesized*/ fun valueOf(/*0*/ value: kotlin.String): D
|
||||
public final /*synthesized*/ fun values(): kotlin.Array<D>
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// !DIAGNOSTICS: -UNUSED_EXPRESSION,-UNUSED_VARIABLE
|
||||
fun foo(x: Int, <!UNUSED_PARAMETER!>y<!>: Any) = x
|
||||
fun foo(<!UNUSED_PARAMETER!>x<!>: Any, y: Int) = y
|
||||
|
||||
fun main() {
|
||||
::<!OVERLOAD_RESOLUTION_AMBIGUITY!>foo<!>
|
||||
|
||||
val fooRef: (Int, Any) -> Unit = ::<!OVERLOAD_RESOLUTION_AMBIGUITY!>foo<!>
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
package
|
||||
|
||||
internal fun foo(/*0*/ x: kotlin.Any, /*1*/ y: kotlin.Int): kotlin.Int
|
||||
internal fun foo(/*0*/ x: kotlin.Int, /*1*/ y: kotlin.Any): kotlin.Int
|
||||
internal fun main(): kotlin.Unit
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
open class A {
|
||||
fun foo() = 42
|
||||
|
||||
object B: A()
|
||||
}
|
||||
|
||||
fun test() {
|
||||
A.B.(A::foo)()
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
package
|
||||
|
||||
internal fun test(): kotlin.Unit
|
||||
|
||||
internal open class A {
|
||||
public constructor A()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
internal final fun foo(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
internal object B : A {
|
||||
private constructor B()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
internal final override /*1*/ /*fake_override*/ fun foo(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
// !CHECK_TYPE
|
||||
|
||||
import kotlin.reflect.KFunction0
|
||||
|
||||
class A {
|
||||
fun main() {
|
||||
val x = ::A
|
||||
|
||||
checkSubtype<KFunction0<A>>(x)
|
||||
}
|
||||
}
|
||||
|
||||
class SomeOtherClass {
|
||||
fun main() {
|
||||
val x = ::A
|
||||
|
||||
checkSubtype<KFunction0<A>>(x)
|
||||
}
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package
|
||||
|
||||
internal final class A {
|
||||
public constructor A()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
internal final fun main(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
internal final class SomeOtherClass {
|
||||
public constructor SomeOtherClass()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
internal final fun main(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
// !CHECK_TYPE
|
||||
|
||||
import kotlin.reflect.KFunction0
|
||||
|
||||
class A
|
||||
class B
|
||||
|
||||
fun A.ext() {
|
||||
val x = ::A
|
||||
val y = ::B
|
||||
|
||||
checkSubtype<KFunction0<A>>(x)
|
||||
checkSubtype<KFunction0<B>>(y)
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package
|
||||
|
||||
internal fun A.ext(): kotlin.Unit
|
||||
|
||||
internal final class A {
|
||||
public constructor A()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
internal final class B {
|
||||
public constructor B()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
// !CHECK_TYPE
|
||||
|
||||
import kotlin.reflect.KFunction0
|
||||
|
||||
class A
|
||||
|
||||
class B {
|
||||
fun A.ext() {
|
||||
val x = ::A
|
||||
val y = ::B
|
||||
|
||||
checkSubtype<KFunction0<A>>(x)
|
||||
checkSubtype<KFunction0<B>>(y)
|
||||
}
|
||||
|
||||
fun B.ext() {
|
||||
val x = ::A
|
||||
val y = ::B
|
||||
|
||||
checkSubtype<KFunction0<A>>(x)
|
||||
checkSubtype<KFunction0<B>>(y)
|
||||
}
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package
|
||||
|
||||
internal final class A {
|
||||
public constructor A()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
internal final class B {
|
||||
public constructor B()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
internal final fun A.ext(): kotlin.Unit
|
||||
internal final fun B.ext(): kotlin.Unit
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
// !CHECK_TYPE
|
||||
|
||||
import kotlin.reflect.KFunction0
|
||||
|
||||
class A
|
||||
|
||||
fun main() {
|
||||
val x = ::A
|
||||
|
||||
checkSubtype<KFunction0<A>>(x)
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
package
|
||||
|
||||
internal fun main(): kotlin.Unit
|
||||
|
||||
internal final class A {
|
||||
public constructor A()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
// !CHECK_TYPE
|
||||
// FILE: a.kt
|
||||
|
||||
package first
|
||||
|
||||
class A {
|
||||
fun foo() {}
|
||||
fun bar(<!UNUSED_PARAMETER!>x<!>: Int) {}
|
||||
fun baz() = "OK"
|
||||
}
|
||||
|
||||
// FILE: b.kt
|
||||
|
||||
package other
|
||||
|
||||
import kotlin.reflect.*
|
||||
|
||||
import first.A
|
||||
|
||||
fun main() {
|
||||
val x = first.A::foo
|
||||
val y = first.A::bar
|
||||
val z = A::baz
|
||||
|
||||
checkSubtype<KMemberFunction0<A, Unit>>(x)
|
||||
checkSubtype<KMemberFunction1<A, Int, Unit>>(y)
|
||||
checkSubtype<KMemberFunction0<A, String>>(z)
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package
|
||||
|
||||
package first {
|
||||
|
||||
internal final class A {
|
||||
public constructor A()
|
||||
internal final fun bar(/*0*/ x: kotlin.Int): kotlin.Unit
|
||||
internal final fun baz(): kotlin.String
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
internal final fun foo(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
|
||||
package other {
|
||||
internal fun main(): kotlin.Unit
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
// !CHECK_TYPE
|
||||
// !DIAGNOSTICS: -UNUSED_EXPRESSION
|
||||
// FILE: a.kt
|
||||
|
||||
package first
|
||||
|
||||
class A
|
||||
|
||||
fun A.foo() {}
|
||||
fun A.bar() {}
|
||||
fun A.baz() {}
|
||||
|
||||
// FILE: b.kt
|
||||
|
||||
package other
|
||||
|
||||
import kotlin.reflect.KExtensionFunction0
|
||||
|
||||
import first.A
|
||||
import first.foo
|
||||
|
||||
fun main() {
|
||||
val x = first.A::foo
|
||||
first.A::<!UNRESOLVED_REFERENCE!>bar<!>
|
||||
A::<!UNRESOLVED_REFERENCE!>baz<!>
|
||||
|
||||
checkSubtype<KExtensionFunction0<A, Unit>>(x)
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package
|
||||
|
||||
package first {
|
||||
internal fun first.A.bar(): kotlin.Unit
|
||||
internal fun first.A.baz(): kotlin.Unit
|
||||
internal fun first.A.foo(): kotlin.Unit
|
||||
|
||||
internal final class A {
|
||||
public constructor A()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
|
||||
package other {
|
||||
internal fun main(): kotlin.Unit
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
// !CHECK_TYPE
|
||||
// FILE: a.kt
|
||||
|
||||
package first
|
||||
|
||||
fun foo() {}
|
||||
fun bar(<!UNUSED_PARAMETER!>x<!>: Int) {}
|
||||
fun baz() = "OK"
|
||||
|
||||
// FILE: b.kt
|
||||
|
||||
package other
|
||||
|
||||
import kotlin.reflect.*
|
||||
|
||||
import first.foo
|
||||
import first.bar
|
||||
import first.baz
|
||||
|
||||
fun main() {
|
||||
val x = ::foo
|
||||
val y = ::bar
|
||||
val z = ::baz
|
||||
|
||||
checkSubtype<KFunction0<Unit>>(x)
|
||||
checkSubtype<KFunction1<Int, Unit>>(y)
|
||||
checkSubtype<KFunction0<String>>(z)
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
package
|
||||
|
||||
package first {
|
||||
internal fun bar(/*0*/ x: kotlin.Int): kotlin.Unit
|
||||
internal fun baz(): kotlin.String
|
||||
internal fun foo(): kotlin.Unit
|
||||
}
|
||||
|
||||
package other {
|
||||
internal fun main(): kotlin.Unit
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
class A
|
||||
|
||||
fun main() {
|
||||
val x = :: <!SYNTAX!><!>;
|
||||
val y = A::
|
||||
<!SYNTAX!><!>}
|
||||
@@ -0,0 +1,10 @@
|
||||
package
|
||||
|
||||
internal fun main(): kotlin.Unit
|
||||
|
||||
internal final class A {
|
||||
public constructor A()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
// !CHECK_TYPE
|
||||
|
||||
import kotlin.reflect.*
|
||||
|
||||
class A {
|
||||
fun main() {
|
||||
val x = ::foo
|
||||
val y = ::bar
|
||||
val z = ::baz
|
||||
|
||||
checkSubtype<KExtensionFunction0<A, Unit>>(x)
|
||||
checkSubtype<KExtensionFunction1<A, Int, Unit>>(y)
|
||||
checkSubtype<KExtensionFunction0<A, String>>(z)
|
||||
}
|
||||
}
|
||||
|
||||
fun A.foo() {}
|
||||
fun A.bar(<!UNUSED_PARAMETER!>x<!>: Int) {}
|
||||
fun A.baz() = "OK"
|
||||
@@ -0,0 +1,13 @@
|
||||
package
|
||||
|
||||
internal fun A.bar(/*0*/ x: kotlin.Int): kotlin.Unit
|
||||
internal fun A.baz(): kotlin.String
|
||||
internal fun A.foo(): kotlin.Unit
|
||||
|
||||
internal final class A {
|
||||
public constructor A()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
internal final fun main(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
// !CHECK_TYPE
|
||||
|
||||
import kotlin.reflect.*
|
||||
|
||||
class A
|
||||
|
||||
fun A.main() {
|
||||
val x = ::foo
|
||||
val y = ::bar
|
||||
val z = ::baz
|
||||
|
||||
checkSubtype<KExtensionFunction0<A, Unit>>(x)
|
||||
checkSubtype<KExtensionFunction1<A, Int, Unit>>(y)
|
||||
checkSubtype<KExtensionFunction0<A, String>>(z)
|
||||
}
|
||||
|
||||
fun A.foo() {}
|
||||
fun A.bar(<!UNUSED_PARAMETER!>x<!>: Int) {}
|
||||
fun A.baz() = "OK"
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package
|
||||
|
||||
internal fun A.bar(/*0*/ x: kotlin.Int): kotlin.Unit
|
||||
internal fun A.baz(): kotlin.String
|
||||
internal fun A.foo(): kotlin.Unit
|
||||
internal fun A.main(): kotlin.Unit
|
||||
|
||||
internal final class A {
|
||||
public constructor A()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
// !CHECK_TYPE
|
||||
|
||||
import kotlin.reflect.*
|
||||
|
||||
class B
|
||||
|
||||
class A {
|
||||
fun B.main() {
|
||||
val x = ::foo
|
||||
val y = ::bar
|
||||
val z = ::baz
|
||||
|
||||
checkSubtype<KExtensionFunction0<A, Unit>>(x)
|
||||
checkSubtype<KExtensionFunction1<A, Int, Unit>>(y)
|
||||
checkSubtype<KExtensionFunction0<A, String>>(z)
|
||||
}
|
||||
}
|
||||
|
||||
fun A.foo() {}
|
||||
fun A.bar(<!UNUSED_PARAMETER!>x<!>: Int) {}
|
||||
fun A.baz() = "OK"
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
package
|
||||
|
||||
internal fun A.bar(/*0*/ x: kotlin.Int): kotlin.Unit
|
||||
internal fun A.baz(): kotlin.String
|
||||
internal fun A.foo(): kotlin.Unit
|
||||
|
||||
internal final class A {
|
||||
public constructor A()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
internal final fun B.main(): kotlin.Unit
|
||||
}
|
||||
|
||||
internal final class B {
|
||||
public constructor B()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
// !CHECK_TYPE
|
||||
|
||||
import kotlin.reflect.*
|
||||
|
||||
class A
|
||||
|
||||
fun A.foo() {}
|
||||
fun A.bar(<!UNUSED_PARAMETER!>x<!>: Int) {}
|
||||
fun A.baz() = "OK"
|
||||
|
||||
fun main() {
|
||||
val x = A::foo
|
||||
val y = A::bar
|
||||
val z = A::baz
|
||||
|
||||
checkSubtype<KExtensionFunction0<A, Unit>>(x)
|
||||
checkSubtype<KExtensionFunction1<A, Int, Unit>>(y)
|
||||
checkSubtype<KExtensionFunction0<A, String>>(z)
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package
|
||||
|
||||
internal fun main(): kotlin.Unit
|
||||
internal fun A.bar(/*0*/ x: kotlin.Int): kotlin.Unit
|
||||
internal fun A.baz(): kotlin.String
|
||||
internal fun A.foo(): kotlin.Unit
|
||||
|
||||
internal final class A {
|
||||
public constructor A()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
// !DIAGNOSTICS: -UNUSED_EXPRESSION
|
||||
class A {
|
||||
fun Int.extInt() = 42
|
||||
fun A.extA(x: String) = x
|
||||
|
||||
fun main() {
|
||||
::<!EXTENSION_IN_CLASS_REFERENCE_NOT_ALLOWED!>extInt<!>
|
||||
::<!EXTENSION_IN_CLASS_REFERENCE_NOT_ALLOWED!>extA<!>
|
||||
}
|
||||
}
|
||||
|
||||
fun main() {
|
||||
A::<!EXTENSION_IN_CLASS_REFERENCE_NOT_ALLOWED!>extInt<!>
|
||||
A::<!EXTENSION_IN_CLASS_REFERENCE_NOT_ALLOWED!>extA<!>
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package
|
||||
|
||||
internal fun main(): kotlin.Unit
|
||||
|
||||
internal final class A {
|
||||
public constructor A()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
internal final fun main(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
internal final fun A.extA(/*0*/ x: kotlin.String): kotlin.String
|
||||
internal final fun kotlin.Int.extInt(): kotlin.Int
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// !DIAGNOSTICS:-UNUSED_VARIABLE
|
||||
|
||||
import kotlin.reflect.*
|
||||
|
||||
class A {
|
||||
fun foo() {}
|
||||
}
|
||||
|
||||
fun A?.foo() {}
|
||||
|
||||
val f: KMemberFunction0<A, Unit> = A::foo
|
||||
val g: KExtensionFunction0<A, Unit> = A?::foo
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package
|
||||
|
||||
internal val f: kotlin.reflect.KMemberFunction0<A, kotlin.Unit>
|
||||
internal val g: kotlin.reflect.KExtensionFunction0<A, kotlin.Unit>
|
||||
internal fun A?.foo(): kotlin.Unit
|
||||
|
||||
internal final class A {
|
||||
public constructor A()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
internal final fun foo(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
// !CHECK_TYPE
|
||||
|
||||
import kotlin.reflect.KMemberFunction0
|
||||
|
||||
class A<T>(val t: T) {
|
||||
fun foo(): T = t
|
||||
}
|
||||
|
||||
fun bar() {
|
||||
val x = A<String>::foo
|
||||
|
||||
checkSubtype<KMemberFunction0<A<String>, String>>(x)
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package
|
||||
|
||||
internal fun bar(): kotlin.Unit
|
||||
|
||||
internal final class A</*0*/ T> {
|
||||
public constructor A</*0*/ T>(/*0*/ t: T)
|
||||
internal final val t: T
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
internal final fun foo(): T
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// !DIAGNOSTICS: -UNUSED_EXPRESSION
|
||||
import A.Inner
|
||||
|
||||
class A {
|
||||
inner class Inner
|
||||
}
|
||||
|
||||
fun main() {
|
||||
::<!UNRESOLVED_REFERENCE!>Inner<!>
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package
|
||||
|
||||
internal fun main(): kotlin.Unit
|
||||
|
||||
internal final class A {
|
||||
public constructor A()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
internal final inner class Inner {
|
||||
public constructor Inner()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
// !CHECK_TYPE
|
||||
// !DIAGNOSTICS: -UNUSED_EXPRESSION
|
||||
import kotlin.reflect.KMemberFunction0
|
||||
|
||||
class A {
|
||||
inner class Inner
|
||||
|
||||
fun main() {
|
||||
val x = ::Inner
|
||||
val y = A::Inner
|
||||
|
||||
checkSubtype<KMemberFunction0<A, A.Inner>>(x)
|
||||
checkSubtype<KMemberFunction0<A, Inner>>(y)
|
||||
}
|
||||
|
||||
companion object {
|
||||
fun main() {
|
||||
::<!INACCESSIBLE_OUTER_CLASS_EXPRESSION!>Inner<!>
|
||||
val y = A::Inner
|
||||
|
||||
checkSubtype<KMemberFunction0<A, A.Inner>>(y)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class B {
|
||||
fun main() {
|
||||
::<!UNRESOLVED_REFERENCE!>Inner<!>
|
||||
val y = A::Inner
|
||||
|
||||
checkSubtype<KMemberFunction0<A, A.Inner>>(y)
|
||||
}
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
package
|
||||
|
||||
internal final class A {
|
||||
public constructor A()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
internal final fun main(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
internal companion object Companion {
|
||||
private constructor Companion()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
internal final fun main(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
internal final inner class Inner {
|
||||
public constructor Inner()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
|
||||
internal final class B {
|
||||
public constructor B()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
internal final fun main(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
// !CHECK_TYPE
|
||||
// !DIAGNOSTICS: -UNUSED_EXPRESSION
|
||||
import kotlin.reflect.KMemberFunction0
|
||||
|
||||
class A {
|
||||
inner class Inner
|
||||
}
|
||||
|
||||
fun A.main() {
|
||||
val x = ::Inner
|
||||
val y = A::Inner
|
||||
|
||||
checkSubtype<KMemberFunction0<A, A.Inner>>(x)
|
||||
checkSubtype<KMemberFunction0<A, A.Inner>>(y)
|
||||
}
|
||||
|
||||
fun Int.main() {
|
||||
::<!UNRESOLVED_REFERENCE!>Inner<!>
|
||||
val y = A::Inner
|
||||
|
||||
checkSubtype<KMemberFunction0<A, A.Inner>>(y)
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package
|
||||
|
||||
internal fun A.main(): kotlin.Unit
|
||||
internal fun kotlin.Int.main(): kotlin.Unit
|
||||
|
||||
internal final class A {
|
||||
public constructor A()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
internal final inner class Inner {
|
||||
public constructor Inner()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
// !CHECK_TYPE
|
||||
// !DIAGNOSTICS: -UNUSED_EXPRESSION
|
||||
import kotlin.reflect.KMemberFunction0
|
||||
|
||||
class A {
|
||||
inner class Inner
|
||||
}
|
||||
|
||||
fun main() {
|
||||
::<!UNRESOLVED_REFERENCE!>Inner<!>
|
||||
val y = A::Inner
|
||||
|
||||
checkSubtype<KMemberFunction0<A, A.Inner>>(y)
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package
|
||||
|
||||
internal fun main(): kotlin.Unit
|
||||
|
||||
internal final class A {
|
||||
public constructor A()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
internal final inner class Inner {
|
||||
public constructor Inner()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
// !CHECK_TYPE
|
||||
// FILE: test/A.java
|
||||
|
||||
package test
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
public class A {
|
||||
public static void main(String[] args) {
|
||||
System.out.println(Arrays.asList(args));
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: 1.kt
|
||||
|
||||
import kotlin.reflect.*
|
||||
import test.A
|
||||
|
||||
fun foo(args: Array<String>) {
|
||||
val main2 = A::main
|
||||
checkSubtype<KFunction1<Array<String>, Unit>>(main2)
|
||||
main2(args)
|
||||
(A::main)(args)
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
package
|
||||
|
||||
internal fun foo(/*0*/ args: kotlin.Array<kotlin.String>): kotlin.Unit
|
||||
@@ -0,0 +1,9 @@
|
||||
class A<T, U : Any> {
|
||||
fun foo() = <!CALLABLE_REFERENCE_LHS_NOT_A_CLASS!>T::<!UNRESOLVED_REFERENCE!>toString<!><!>
|
||||
|
||||
fun bar() = <!CALLABLE_REFERENCE_LHS_NOT_A_CLASS!>U::<!UNRESOLVED_REFERENCE!>toString<!><!>
|
||||
}
|
||||
|
||||
fun <T> foo() = <!CALLABLE_REFERENCE_LHS_NOT_A_CLASS!>T::<!UNRESOLVED_REFERENCE!>toString<!><!>
|
||||
|
||||
fun <U : Any> bar() = <!CALLABLE_REFERENCE_LHS_NOT_A_CLASS!>U::<!UNRESOLVED_REFERENCE!>toString<!><!>
|
||||
@@ -0,0 +1,13 @@
|
||||
package
|
||||
|
||||
internal fun </*0*/ U : kotlin.Any> bar(): [ERROR : Error function type]
|
||||
internal fun </*0*/ T> foo(): [ERROR : Error function type]
|
||||
|
||||
internal final class A</*0*/ T, /*1*/ U : kotlin.Any> {
|
||||
public constructor A</*0*/ T, /*1*/ U : kotlin.Any>()
|
||||
internal final fun bar(): [ERROR : Error function type]
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
internal final fun foo(): [ERROR : Error function type]
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// !CHECK_TYPE
|
||||
|
||||
import kotlin.reflect.KFunction0
|
||||
|
||||
fun main() {
|
||||
class A
|
||||
|
||||
val x = ::A
|
||||
checkSubtype<KFunction0<A>>(x)
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
package
|
||||
|
||||
internal fun main(): kotlin.Unit
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
// !CHECK_TYPE
|
||||
|
||||
import kotlin.reflect.KFunction0
|
||||
|
||||
fun main() {
|
||||
class A
|
||||
|
||||
class B {
|
||||
fun Int.foo() {
|
||||
val x = ::A
|
||||
checkSubtype<KFunction0<A>>(x)
|
||||
}
|
||||
fun A.foo() {
|
||||
val x = ::A
|
||||
checkSubtype<KFunction0<A>>(x)
|
||||
}
|
||||
}
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
package
|
||||
|
||||
internal fun main(): kotlin.Unit
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
import kotlin.reflect.KFunction0
|
||||
|
||||
fun main() {
|
||||
class A
|
||||
|
||||
class B {
|
||||
val x = ::A
|
||||
val f: KFunction0<A> = x
|
||||
}
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
package
|
||||
|
||||
internal fun main(): kotlin.Unit
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
// !CHECK_TYPE
|
||||
|
||||
import kotlin.reflect.KFunction0
|
||||
|
||||
fun main() {
|
||||
class A
|
||||
|
||||
fun A.foo() {
|
||||
val x = ::A
|
||||
checkSubtype<KFunction0<A>>(x)
|
||||
}
|
||||
|
||||
fun Int.foo() {
|
||||
val x = ::A
|
||||
checkSubtype<KFunction0<A>>(x)
|
||||
}
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
package
|
||||
|
||||
internal fun main(): kotlin.Unit
|
||||
@@ -0,0 +1,17 @@
|
||||
// !CHECK_TYPE
|
||||
|
||||
import kotlin.reflect.*
|
||||
|
||||
fun main() {
|
||||
fun foo() {}
|
||||
fun bar(<!UNUSED_PARAMETER!>x<!>: Int) {}
|
||||
fun baz() = "OK"
|
||||
|
||||
val x = ::foo
|
||||
val y = ::bar
|
||||
val z = ::baz
|
||||
|
||||
checkSubtype<KFunction0<Unit>>(x)
|
||||
checkSubtype<KFunction1<Int, Unit>>(y)
|
||||
checkSubtype<KFunction0<String>>(z)
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
package
|
||||
|
||||
internal fun main(): kotlin.Unit
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
// !CHECK_TYPE
|
||||
|
||||
import kotlin.reflect.*
|
||||
|
||||
class A
|
||||
|
||||
fun main() {
|
||||
fun foo() {}
|
||||
fun bar(<!UNUSED_PARAMETER!>x<!>: Int) {}
|
||||
fun baz() = "OK"
|
||||
|
||||
class B {
|
||||
fun A.ext() {
|
||||
val x = ::foo
|
||||
val y = ::bar
|
||||
val z = ::baz
|
||||
|
||||
checkSubtype<KFunction0<Unit>>(x)
|
||||
checkSubtype<KFunction1<Int, Unit>>(y)
|
||||
checkSubtype<KFunction0<String>>(z)
|
||||
}
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
package
|
||||
|
||||
internal fun main(): kotlin.Unit
|
||||
|
||||
internal final class A {
|
||||
public constructor A()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
// !CHECK_TYPE
|
||||
|
||||
import kotlin.reflect.*
|
||||
|
||||
fun main() {
|
||||
fun foo() {}
|
||||
fun bar(<!UNUSED_PARAMETER!>x<!>: Int) {}
|
||||
fun baz() = "OK"
|
||||
|
||||
class A {
|
||||
val x = ::foo
|
||||
val y = ::bar
|
||||
val z = ::baz
|
||||
|
||||
fun main() {
|
||||
checkSubtype<KFunction0<Unit>>(x)
|
||||
checkSubtype<KFunction1<Int, Unit>>(y)
|
||||
checkSubtype<KFunction0<String>>(z)
|
||||
}
|
||||
}
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
package
|
||||
|
||||
internal fun main(): kotlin.Unit
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
// !CHECK_TYPE
|
||||
|
||||
import kotlin.reflect.*
|
||||
|
||||
class A
|
||||
|
||||
fun main() {
|
||||
fun foo() {}
|
||||
fun bar(<!UNUSED_PARAMETER!>x<!>: Int) {}
|
||||
fun baz() = "OK"
|
||||
|
||||
fun A.ext() {
|
||||
val x = ::foo
|
||||
val y = ::bar
|
||||
val z = ::baz
|
||||
|
||||
checkSubtype<KFunction0<Unit>>(x)
|
||||
checkSubtype<KFunction1<Int, Unit>>(y)
|
||||
checkSubtype<KFunction0<String>>(z)
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
package
|
||||
|
||||
internal fun main(): kotlin.Unit
|
||||
|
||||
internal final class A {
|
||||
public constructor A()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
// !CHECK_TYPE
|
||||
// FILE: a.kt
|
||||
|
||||
package a.b.c
|
||||
|
||||
class D {
|
||||
fun foo() = 42
|
||||
}
|
||||
|
||||
// FILE: b.kt
|
||||
|
||||
import kotlin.reflect.KMemberFunction0
|
||||
|
||||
fun main() {
|
||||
val x = a.b.c.D::foo
|
||||
|
||||
checkSubtype<KMemberFunction0<a.b.c.D, Int>>(x)
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package
|
||||
|
||||
internal fun main(): kotlin.Unit
|
||||
|
||||
package a {
|
||||
|
||||
package a.b {
|
||||
|
||||
package a.b.c {
|
||||
|
||||
internal final class D {
|
||||
public constructor D()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
internal final fun foo(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
// !CHECK_TYPE
|
||||
// FILE: a.kt
|
||||
|
||||
package a.b.c
|
||||
|
||||
class D<E, F> {
|
||||
fun foo(<!UNUSED_PARAMETER!>e<!>: E, <!UNUSED_PARAMETER!>f<!>: F) = this
|
||||
}
|
||||
|
||||
// FILE: b.kt
|
||||
|
||||
import kotlin.reflect.KMemberFunction2
|
||||
|
||||
fun main() {
|
||||
val x = a.b.c.D<String, Int>::foo
|
||||
|
||||
checkSubtype<KMemberFunction2<a.b.c.D<String, Int>, String, Int, a.b.c.D<String, Int>>>(x)
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
package
|
||||
|
||||
internal fun main(): kotlin.Unit
|
||||
|
||||
package a {
|
||||
|
||||
package a.b {
|
||||
|
||||
package a.b.c {
|
||||
|
||||
internal final class D</*0*/ E, /*1*/ F> {
|
||||
public constructor D</*0*/ E, /*1*/ F>()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
internal final fun foo(/*0*/ e: E, /*1*/ f: F): a.b.c.D<E, F>
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
// !CHECK_TYPE
|
||||
|
||||
import kotlin.reflect.*
|
||||
|
||||
class A {
|
||||
fun foo() {}
|
||||
fun bar(<!UNUSED_PARAMETER!>x<!>: Int) {}
|
||||
fun baz() = "OK"
|
||||
|
||||
fun main() {
|
||||
val x = ::foo
|
||||
val y = ::bar
|
||||
val z = ::baz
|
||||
|
||||
checkSubtype<KMemberFunction0<A, Unit>>(x)
|
||||
checkSubtype<KMemberFunction1<A, Int, Unit>>(y)
|
||||
checkSubtype<KMemberFunction0<A, String>>(z)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package
|
||||
|
||||
internal final class A {
|
||||
public constructor A()
|
||||
internal final fun bar(/*0*/ x: kotlin.Int): kotlin.Unit
|
||||
internal final fun baz(): kotlin.String
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
internal final fun foo(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
internal final fun main(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
// !CHECK_TYPE
|
||||
|
||||
import kotlin.reflect.*
|
||||
|
||||
class A {
|
||||
fun foo() {}
|
||||
fun bar(<!UNUSED_PARAMETER!>x<!>: Int) {}
|
||||
fun baz() = "OK"
|
||||
}
|
||||
|
||||
fun A.main() {
|
||||
val x = ::foo
|
||||
val y = ::bar
|
||||
val z = ::baz
|
||||
|
||||
checkSubtype<KMemberFunction0<A, Unit>>(x)
|
||||
checkSubtype<KMemberFunction1<A, Int, Unit>>(y)
|
||||
checkSubtype<KMemberFunction0<A, String>>(z)
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package
|
||||
|
||||
internal fun A.main(): kotlin.Unit
|
||||
|
||||
internal final class A {
|
||||
public constructor A()
|
||||
internal final fun bar(/*0*/ x: kotlin.Int): kotlin.Unit
|
||||
internal final fun baz(): kotlin.String
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
internal final fun foo(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
// !CHECK_TYPE
|
||||
|
||||
import kotlin.reflect.*
|
||||
|
||||
class A {
|
||||
fun foo() {}
|
||||
fun bar(<!UNUSED_PARAMETER!>x<!>: Int) {}
|
||||
fun baz() = "OK"
|
||||
}
|
||||
|
||||
class B {
|
||||
fun A.main() {
|
||||
val x = ::foo
|
||||
val y = ::bar
|
||||
val z = ::baz
|
||||
|
||||
checkSubtype<KMemberFunction0<A, Unit>>(x)
|
||||
checkSubtype<KMemberFunction1<A, Int, Unit>>(y)
|
||||
checkSubtype<KMemberFunction0<A, String>>(z)
|
||||
}
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
package
|
||||
|
||||
internal final class A {
|
||||
public constructor A()
|
||||
internal final fun bar(/*0*/ x: kotlin.Int): kotlin.Unit
|
||||
internal final fun baz(): kotlin.String
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
internal final fun foo(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
internal final class B {
|
||||
public constructor B()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
internal final fun A.main(): kotlin.Unit
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
// !CHECK_TYPE
|
||||
|
||||
import kotlin.reflect.*
|
||||
|
||||
class A {
|
||||
fun foo() {}
|
||||
fun bar(<!UNUSED_PARAMETER!>x<!>: Int) {}
|
||||
fun baz() = "OK"
|
||||
}
|
||||
|
||||
fun main() {
|
||||
val x = A::foo
|
||||
val y = A::bar
|
||||
val z = A::baz
|
||||
|
||||
checkSubtype<KMemberFunction0<A, Unit>>(x)
|
||||
checkSubtype<KMemberFunction1<A, Int, Unit>>(y)
|
||||
checkSubtype<KMemberFunction0<A, String>>(z)
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package
|
||||
|
||||
internal fun main(): kotlin.Unit
|
||||
|
||||
internal final class A {
|
||||
public constructor A()
|
||||
internal final fun bar(/*0*/ x: kotlin.Int): kotlin.Unit
|
||||
internal final fun baz(): kotlin.String
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
internal final fun foo(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
// !CHECK_TYPE
|
||||
// !DIAGNOSTICS: -UNUSED_EXPRESSION
|
||||
import kotlin.reflect.KFunction0
|
||||
|
||||
class A {
|
||||
class Nested
|
||||
|
||||
fun main() {
|
||||
val x = ::Nested
|
||||
val y = A::Nested
|
||||
|
||||
checkSubtype<KFunction0<Nested>>(x)
|
||||
checkSubtype<KFunction0<Nested>>(y)
|
||||
}
|
||||
|
||||
companion object {
|
||||
fun main() {
|
||||
::Nested
|
||||
val y = A::Nested
|
||||
|
||||
checkSubtype<KFunction0<A.Nested>>(y)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class B {
|
||||
fun main() {
|
||||
::<!UNRESOLVED_REFERENCE!>Nested<!>
|
||||
val y = A::Nested
|
||||
|
||||
checkSubtype<KFunction0<A.Nested>>(y)
|
||||
}
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
package
|
||||
|
||||
internal final class A {
|
||||
public constructor A()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
internal final fun main(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
internal companion object Companion {
|
||||
private constructor Companion()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
internal final fun main(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
internal final class Nested {
|
||||
public constructor Nested()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
|
||||
internal final class B {
|
||||
public constructor B()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
internal final fun main(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
// !CHECK_TYPE
|
||||
// !DIAGNOSTICS: -UNUSED_EXPRESSION
|
||||
import kotlin.reflect.KFunction0
|
||||
|
||||
class A {
|
||||
class Nested
|
||||
}
|
||||
|
||||
fun A.main() {
|
||||
::<!NESTED_CLASS_SHOULD_BE_QUALIFIED!>Nested<!>
|
||||
val y = A::Nested
|
||||
|
||||
checkSubtype<KFunction0<A.Nested>>(y)
|
||||
}
|
||||
|
||||
fun Int.main() {
|
||||
::<!UNRESOLVED_REFERENCE!>Nested<!>
|
||||
val y = A::Nested
|
||||
|
||||
checkSubtype<KFunction0<A.Nested>>(y)
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package
|
||||
|
||||
internal fun A.main(): kotlin.Unit
|
||||
internal fun kotlin.Int.main(): kotlin.Unit
|
||||
|
||||
internal final class A {
|
||||
public constructor A()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
internal final class Nested {
|
||||
public constructor Nested()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
// !CHECK_TYPE
|
||||
|
||||
import kotlin.reflect.KFunction0
|
||||
|
||||
class A {
|
||||
class Nested
|
||||
}
|
||||
|
||||
fun main() {
|
||||
val x = A::Nested
|
||||
|
||||
checkSubtype<KFunction0<A.Nested>>(x)
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package
|
||||
|
||||
internal fun main(): kotlin.Unit
|
||||
|
||||
internal final class A {
|
||||
public constructor A()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
internal final class Nested {
|
||||
public constructor Nested()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// !DIAGNOSTICS: -UNUSED_EXPRESSION
|
||||
fun bar() = 42
|
||||
|
||||
fun main() {
|
||||
fun bar() = 239
|
||||
|
||||
::bar
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
package
|
||||
|
||||
internal fun bar(): kotlin.Int
|
||||
internal fun main(): kotlin.Unit
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
// !CHECK_TYPE
|
||||
|
||||
import kotlin.reflect.KMemberFunction0
|
||||
|
||||
class A {
|
||||
fun foo() = 42
|
||||
}
|
||||
|
||||
fun A.foo() {}
|
||||
|
||||
fun main() {
|
||||
val x = A::foo
|
||||
|
||||
checkSubtype<KMemberFunction0<A, Int>>(x)
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package
|
||||
|
||||
internal fun main(): kotlin.Unit
|
||||
internal fun A.foo(): kotlin.Unit
|
||||
|
||||
internal final class A {
|
||||
public constructor A()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
internal final fun foo(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
// !CHECK_TYPE
|
||||
|
||||
import kotlin.reflect.KMemberFunction0
|
||||
|
||||
fun foo() {}
|
||||
|
||||
class A {
|
||||
fun foo() {}
|
||||
|
||||
fun main() {
|
||||
val x = ::foo
|
||||
|
||||
checkSubtype<KMemberFunction0<A, Unit>>(x)
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package
|
||||
|
||||
internal fun foo(): kotlin.Unit
|
||||
|
||||
internal final class A {
|
||||
public constructor A()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
internal final fun foo(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
internal final fun main(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
// !CHECK_TYPE
|
||||
// FILE: a.kt
|
||||
|
||||
package other
|
||||
|
||||
fun foo() {}
|
||||
|
||||
class A {
|
||||
fun bar() = 42
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
fun main() {
|
||||
val x = ::foofoo
|
||||
val y = AA::bar
|
||||
val z = AA::bazbaz
|
||||
|
||||
checkSubtype<KFunction0<Unit>>(x)
|
||||
checkSubtype<KMemberFunction0<AA, Int>>(y)
|
||||
checkSubtype<KExtensionFunction1<AA, String, Unit>>(z)
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package
|
||||
|
||||
internal fun main(): kotlin.Unit
|
||||
|
||||
package other {
|
||||
internal fun foo(): kotlin.Unit
|
||||
internal fun other.A.baz(/*0*/ x: kotlin.String): kotlin.Unit
|
||||
|
||||
internal final class A {
|
||||
public constructor A()
|
||||
internal final fun bar(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
// !CHECK_TYPE
|
||||
|
||||
import kotlin.reflect.*
|
||||
|
||||
fun foo() {}
|
||||
fun bar(<!UNUSED_PARAMETER!>x<!>: Int) {}
|
||||
fun baz() = "OK"
|
||||
|
||||
class A {
|
||||
fun main() {
|
||||
val x = ::foo
|
||||
val y = ::bar
|
||||
val z = ::baz
|
||||
|
||||
checkSubtype<KFunction0<Unit>>(x)
|
||||
checkSubtype<KFunction1<Int, Unit>>(y)
|
||||
checkSubtype<KFunction0<String>>(z)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package
|
||||
|
||||
internal fun bar(/*0*/ x: kotlin.Int): kotlin.Unit
|
||||
internal fun baz(): kotlin.String
|
||||
internal fun foo(): kotlin.Unit
|
||||
|
||||
internal final class A {
|
||||
public constructor A()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
internal final fun main(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
// !CHECK_TYPE
|
||||
|
||||
import kotlin.reflect.*
|
||||
|
||||
class A
|
||||
|
||||
fun foo() {}
|
||||
fun bar(<!UNUSED_PARAMETER!>x<!>: Int) {}
|
||||
fun baz() = "OK"
|
||||
|
||||
fun A.main() {
|
||||
val x = ::foo
|
||||
val y = ::bar
|
||||
val z = ::baz
|
||||
|
||||
checkSubtype<KFunction0<Unit>>(x)
|
||||
checkSubtype<KFunction1<Int, Unit>>(y)
|
||||
checkSubtype<KFunction0<String>>(z)
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package
|
||||
|
||||
internal fun bar(/*0*/ x: kotlin.Int): kotlin.Unit
|
||||
internal fun baz(): kotlin.String
|
||||
internal fun foo(): kotlin.Unit
|
||||
internal fun A.main(): kotlin.Unit
|
||||
|
||||
internal final class A {
|
||||
public constructor A()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
// !CHECK_TYPE
|
||||
|
||||
import kotlin.reflect.*
|
||||
|
||||
class A
|
||||
|
||||
fun foo() {}
|
||||
fun bar(<!UNUSED_PARAMETER!>x<!>: Int) {}
|
||||
fun baz() = "OK"
|
||||
|
||||
class B {
|
||||
fun A.main() {
|
||||
val x = ::foo
|
||||
val y = ::bar
|
||||
val z = ::baz
|
||||
|
||||
checkSubtype<KFunction0<Unit>>(x)
|
||||
checkSubtype<KFunction1<Int, Unit>>(y)
|
||||
checkSubtype<KFunction0<String>>(z)
|
||||
}
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
package
|
||||
|
||||
internal fun bar(/*0*/ x: kotlin.Int): kotlin.Unit
|
||||
internal fun baz(): kotlin.String
|
||||
internal fun foo(): kotlin.Unit
|
||||
|
||||
internal final class A {
|
||||
public constructor A()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
internal final class B {
|
||||
public constructor B()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
internal final fun A.main(): kotlin.Unit
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
// !CHECK_TYPE
|
||||
|
||||
import kotlin.reflect.*
|
||||
|
||||
fun foo() {}
|
||||
fun bar(<!UNUSED_PARAMETER!>x<!>: Int) {}
|
||||
fun baz() = "OK"
|
||||
|
||||
fun main() {
|
||||
val x = ::foo
|
||||
val y = ::bar
|
||||
val z = ::baz
|
||||
|
||||
checkSubtype<KFunction0<Unit>>(x)
|
||||
checkSubtype<KFunction1<Int, Unit>>(y)
|
||||
checkSubtype<KFunction0<String>>(z)
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
package
|
||||
|
||||
internal fun bar(/*0*/ x: kotlin.Int): kotlin.Unit
|
||||
internal fun baz(): kotlin.String
|
||||
internal fun foo(): kotlin.Unit
|
||||
internal fun main(): kotlin.Unit
|
||||
@@ -0,0 +1,12 @@
|
||||
// !DIAGNOSTICS: -UNUSED_EXPRESSION
|
||||
class A
|
||||
|
||||
fun main() {
|
||||
val <!UNUSED_VARIABLE!>foo<!> = ::<!UNRESOLVED_REFERENCE!>foo<!>
|
||||
|
||||
::<!UNRESOLVED_REFERENCE!>bar<!>
|
||||
|
||||
A::<!UNRESOLVED_REFERENCE!>bar<!>
|
||||
|
||||
<!UNRESOLVED_REFERENCE!>B<!>::<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>bar<!>
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package
|
||||
|
||||
internal fun main(): kotlin.Unit
|
||||
|
||||
internal final class A {
|
||||
public constructor A()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
Reference in New Issue
Block a user