PSI2IR KT-47939 callable references to fun interface constructors
This commit is contained in:
committed by
TeamCityServer
parent
1fd0dec5e7
commit
27a144f86f
+128
@@ -0,0 +1,128 @@
|
||||
FILE fqName:<root> fileName:/funInterfaceConstructorReference.kt
|
||||
CLASS INTERFACE name:KRunnable modality:ABSTRACT visibility:public [fun] superTypes:[kotlin.Any]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.KRunnable
|
||||
FUN name:run visibility:public modality:ABSTRACT <> ($this:<root>.KRunnable) returnType:kotlin.Unit
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.KRunnable
|
||||
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
|
||||
overridden:
|
||||
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
|
||||
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
|
||||
overridden:
|
||||
public open fun hashCode (): kotlin.Int declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
|
||||
overridden:
|
||||
public open fun toString (): kotlin.String declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||
TYPEALIAS name:KR visibility:public expandedType:<root>.KRunnable
|
||||
CLASS INTERFACE name:KSupplier modality:ABSTRACT visibility:public [fun] superTypes:[kotlin.Any]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.KSupplier<T of <root>.KSupplier>
|
||||
TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?]
|
||||
FUN name:get visibility:public modality:ABSTRACT <> ($this:<root>.KSupplier<T of <root>.KSupplier>) returnType:T of <root>.KSupplier
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.KSupplier<T of <root>.KSupplier>
|
||||
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
|
||||
overridden:
|
||||
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
|
||||
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
|
||||
overridden:
|
||||
public open fun hashCode (): kotlin.Int declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
|
||||
overridden:
|
||||
public open fun toString (): kotlin.String declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||
TYPEALIAS name:KSS visibility:public expandedType:<root>.KSupplier<kotlin.String>
|
||||
CLASS INTERFACE name:KConsumer modality:ABSTRACT visibility:public [fun] superTypes:[kotlin.Any]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.KConsumer<T of <root>.KConsumer>
|
||||
TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?]
|
||||
FUN name:accept visibility:public modality:ABSTRACT <> ($this:<root>.KConsumer<T of <root>.KConsumer>, x:T of <root>.KConsumer) returnType:kotlin.Unit
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.KConsumer<T of <root>.KConsumer>
|
||||
VALUE_PARAMETER name:x index:0 type:T of <root>.KConsumer
|
||||
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
|
||||
overridden:
|
||||
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
|
||||
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
|
||||
overridden:
|
||||
public open fun hashCode (): kotlin.Int declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
|
||||
overridden:
|
||||
public open fun toString (): kotlin.String declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||
TYPEALIAS name:KCS visibility:public expandedType:<root>.KConsumer<kotlin.String>
|
||||
FUN name:test1 visibility:public modality:FINAL <> () returnType:kotlin.reflect.KFunction1<@[ParameterName(name = 'function')] kotlin.Function0<kotlin.Unit>, <root>.KRunnable>
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun test1 (): kotlin.reflect.KFunction1<@[ParameterName(name = 'function')] kotlin.Function0<kotlin.Unit>, <root>.KRunnable> declared in <root>'
|
||||
BLOCK type=kotlin.reflect.KFunction1<@[ParameterName(name = 'function')] kotlin.Function0<kotlin.Unit>, <root>.KRunnable> origin=FUN_INTERFACE_CONSTRUCTOR_REFERENCE
|
||||
FUN ADAPTER_FOR_FUN_INTERFACE_CONSTRUCTOR name:KRunnable visibility:local modality:FINAL <> (function:kotlin.Function0<kotlin.Unit>) returnType:<root>.KRunnable
|
||||
VALUE_PARAMETER ADAPTER_PARAMETER_FOR_CALLABLE_REFERENCE name:function index:0 type:kotlin.Function0<kotlin.Unit>
|
||||
EXPRESSION_BODY
|
||||
TYPE_OP type=<root>.KRunnable origin=SAM_CONVERSION typeOperand=<root>.KRunnable
|
||||
GET_VAR 'function: kotlin.Function0<kotlin.Unit> declared in <root>.test1.KRunnable' type=kotlin.Function0<kotlin.Unit> origin=null
|
||||
FUNCTION_REFERENCE 'local final fun KRunnable (function: kotlin.Function0<kotlin.Unit>): <root>.KRunnable declared in <root>.test1' type=kotlin.reflect.KFunction1<@[ParameterName(name = 'function')] kotlin.Function0<kotlin.Unit>, <root>.KRunnable> origin=FUN_INTERFACE_CONSTRUCTOR_REFERENCE reflectionTarget=<same>
|
||||
FUN name:test1a visibility:public modality:FINAL <> () returnType:kotlin.reflect.KFunction1<@[ParameterName(name = 'function')] kotlin.Function0<kotlin.Unit>, <root>.KRunnable>
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun test1a (): kotlin.reflect.KFunction1<@[ParameterName(name = 'function')] kotlin.Function0<kotlin.Unit>, <root>.KRunnable> declared in <root>'
|
||||
BLOCK type=kotlin.reflect.KFunction1<@[ParameterName(name = 'function')] kotlin.Function0<kotlin.Unit>, <root>.KRunnable> origin=FUN_INTERFACE_CONSTRUCTOR_REFERENCE
|
||||
FUN ADAPTER_FOR_FUN_INTERFACE_CONSTRUCTOR name:KRunnable visibility:local modality:FINAL <> (function:kotlin.Function0<kotlin.Unit>) returnType:<root>.KRunnable
|
||||
VALUE_PARAMETER ADAPTER_PARAMETER_FOR_CALLABLE_REFERENCE name:function index:0 type:kotlin.Function0<kotlin.Unit>
|
||||
EXPRESSION_BODY
|
||||
TYPE_OP type=<root>.KRunnable origin=SAM_CONVERSION typeOperand=<root>.KRunnable
|
||||
GET_VAR 'function: kotlin.Function0<kotlin.Unit> declared in <root>.test1a.KRunnable' type=kotlin.Function0<kotlin.Unit> origin=null
|
||||
FUNCTION_REFERENCE 'local final fun KRunnable (function: kotlin.Function0<kotlin.Unit>): <root>.KRunnable declared in <root>.test1a' type=kotlin.reflect.KFunction1<@[ParameterName(name = 'function')] kotlin.Function0<kotlin.Unit>, <root>.KRunnable> origin=FUN_INTERFACE_CONSTRUCTOR_REFERENCE reflectionTarget=<same>
|
||||
FUN name:test1b visibility:public modality:FINAL <> () returnType:kotlin.reflect.KFunction<java.lang.Runnable>
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun test1b (): kotlin.reflect.KFunction<java.lang.Runnable> declared in <root>'
|
||||
BLOCK type=kotlin.reflect.KFunction1<@[ParameterName(name = 'function')] kotlin.Function0<kotlin.Unit>, java.lang.Runnable> origin=FUN_INTERFACE_CONSTRUCTOR_REFERENCE
|
||||
FUN ADAPTER_FOR_FUN_INTERFACE_CONSTRUCTOR name:Runnable visibility:local modality:FINAL <> (function:kotlin.Function0<kotlin.Unit>) returnType:java.lang.Runnable
|
||||
VALUE_PARAMETER ADAPTER_PARAMETER_FOR_CALLABLE_REFERENCE name:function index:0 type:kotlin.Function0<kotlin.Unit>
|
||||
EXPRESSION_BODY
|
||||
TYPE_OP type=java.lang.Runnable origin=SAM_CONVERSION typeOperand=java.lang.Runnable
|
||||
GET_VAR 'function: kotlin.Function0<kotlin.Unit> declared in <root>.test1b.Runnable' type=kotlin.Function0<kotlin.Unit> origin=null
|
||||
FUNCTION_REFERENCE 'local final fun Runnable (function: kotlin.Function0<kotlin.Unit>): java.lang.Runnable declared in <root>.test1b' type=kotlin.reflect.KFunction1<@[ParameterName(name = 'function')] kotlin.Function0<kotlin.Unit>, java.lang.Runnable> origin=FUN_INTERFACE_CONSTRUCTOR_REFERENCE reflectionTarget=<same>
|
||||
FUN name:test2 visibility:public modality:FINAL <> () returnType:kotlin.Function1<kotlin.Function0<kotlin.String>, <root>.KSupplier<kotlin.String>>
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun test2 (): kotlin.Function1<kotlin.Function0<kotlin.String>, <root>.KSupplier<kotlin.String>> declared in <root>'
|
||||
BLOCK type=kotlin.reflect.KFunction1<@[ParameterName(name = 'function')] kotlin.Function0<kotlin.String>, <root>.KSupplier<kotlin.String>> origin=FUN_INTERFACE_CONSTRUCTOR_REFERENCE
|
||||
FUN ADAPTER_FOR_FUN_INTERFACE_CONSTRUCTOR name:KSupplier visibility:local modality:FINAL <> (function:kotlin.Function0<kotlin.String>) returnType:<root>.KSupplier<kotlin.String>
|
||||
VALUE_PARAMETER ADAPTER_PARAMETER_FOR_CALLABLE_REFERENCE name:function index:0 type:kotlin.Function0<kotlin.String>
|
||||
EXPRESSION_BODY
|
||||
TYPE_OP type=<root>.KSupplier<kotlin.String> origin=SAM_CONVERSION typeOperand=<root>.KSupplier<kotlin.String>
|
||||
GET_VAR 'function: kotlin.Function0<kotlin.String> declared in <root>.test2.KSupplier' type=kotlin.Function0<kotlin.String> origin=null
|
||||
FUNCTION_REFERENCE 'local final fun KSupplier (function: kotlin.Function0<kotlin.String>): <root>.KSupplier<kotlin.String> declared in <root>.test2' type=kotlin.reflect.KFunction1<@[ParameterName(name = 'function')] kotlin.Function0<kotlin.String>, <root>.KSupplier<kotlin.String>> origin=FUN_INTERFACE_CONSTRUCTOR_REFERENCE reflectionTarget=<same>
|
||||
FUN name:test2a visibility:public modality:FINAL <> () returnType:kotlin.Function1<kotlin.Function0<kotlin.String>, <root>.KSupplier<kotlin.String>>
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun test2a (): kotlin.Function1<kotlin.Function0<kotlin.String>, <root>.KSupplier<kotlin.String>> declared in <root>'
|
||||
BLOCK type=kotlin.reflect.KFunction1<@[ParameterName(name = 'function')] kotlin.Function0<kotlin.String>, <root>.KSupplier<kotlin.String>> origin=FUN_INTERFACE_CONSTRUCTOR_REFERENCE
|
||||
FUN ADAPTER_FOR_FUN_INTERFACE_CONSTRUCTOR name:KSupplier visibility:local modality:FINAL <> (function:kotlin.Function0<kotlin.String>) returnType:<root>.KSupplier<kotlin.String>
|
||||
VALUE_PARAMETER ADAPTER_PARAMETER_FOR_CALLABLE_REFERENCE name:function index:0 type:kotlin.Function0<kotlin.String>
|
||||
EXPRESSION_BODY
|
||||
TYPE_OP type=<root>.KSupplier<kotlin.String> origin=SAM_CONVERSION typeOperand=<root>.KSupplier<kotlin.String>
|
||||
GET_VAR 'function: kotlin.Function0<kotlin.String> declared in <root>.test2a.KSupplier' type=kotlin.Function0<kotlin.String> origin=null
|
||||
FUNCTION_REFERENCE 'local final fun KSupplier (function: kotlin.Function0<kotlin.String>): <root>.KSupplier<kotlin.String> declared in <root>.test2a' type=kotlin.reflect.KFunction1<@[ParameterName(name = 'function')] kotlin.Function0<kotlin.String>, <root>.KSupplier<kotlin.String>> origin=FUN_INTERFACE_CONSTRUCTOR_REFERENCE reflectionTarget=<same>
|
||||
FUN name:test3 visibility:public modality:FINAL <> () returnType:kotlin.Function1<kotlin.Function1<kotlin.String, kotlin.Unit>, <root>.KConsumer<kotlin.String>>
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun test3 (): kotlin.Function1<kotlin.Function1<kotlin.String, kotlin.Unit>, <root>.KConsumer<kotlin.String>> declared in <root>'
|
||||
BLOCK type=kotlin.reflect.KFunction1<@[ParameterName(name = 'function')] kotlin.Function1<@[ParameterName(name = 'x')] kotlin.String, kotlin.Unit>, <root>.KConsumer<kotlin.String>> origin=FUN_INTERFACE_CONSTRUCTOR_REFERENCE
|
||||
FUN ADAPTER_FOR_FUN_INTERFACE_CONSTRUCTOR name:KConsumer visibility:local modality:FINAL <> (function:kotlin.Function1<@[ParameterName(name = 'x')] kotlin.String, kotlin.Unit>) returnType:<root>.KConsumer<kotlin.String>
|
||||
VALUE_PARAMETER ADAPTER_PARAMETER_FOR_CALLABLE_REFERENCE name:function index:0 type:kotlin.Function1<@[ParameterName(name = 'x')] kotlin.String, kotlin.Unit>
|
||||
EXPRESSION_BODY
|
||||
TYPE_OP type=<root>.KConsumer<kotlin.String> origin=SAM_CONVERSION typeOperand=<root>.KConsumer<kotlin.String>
|
||||
GET_VAR 'function: kotlin.Function1<@[ParameterName(name = 'x')] kotlin.String, kotlin.Unit> declared in <root>.test3.KConsumer' type=kotlin.Function1<@[ParameterName(name = 'x')] kotlin.String, kotlin.Unit> origin=null
|
||||
FUNCTION_REFERENCE 'local final fun KConsumer (function: kotlin.Function1<@[ParameterName(name = 'x')] kotlin.String, kotlin.Unit>): <root>.KConsumer<kotlin.String> declared in <root>.test3' type=kotlin.reflect.KFunction1<@[ParameterName(name = 'function')] kotlin.Function1<@[ParameterName(name = 'x')] kotlin.String, kotlin.Unit>, <root>.KConsumer<kotlin.String>> origin=FUN_INTERFACE_CONSTRUCTOR_REFERENCE reflectionTarget=<same>
|
||||
FUN name:test3a visibility:public modality:FINAL <> () returnType:kotlin.Function1<kotlin.Function1<kotlin.String, kotlin.Unit>, <root>.KConsumer<kotlin.String>>
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun test3a (): kotlin.Function1<kotlin.Function1<kotlin.String, kotlin.Unit>, <root>.KConsumer<kotlin.String>> declared in <root>'
|
||||
BLOCK type=kotlin.reflect.KFunction1<@[ParameterName(name = 'function')] kotlin.Function1<@[ParameterName(name = 'x')] kotlin.String, kotlin.Unit>, <root>.KConsumer<kotlin.String>> origin=FUN_INTERFACE_CONSTRUCTOR_REFERENCE
|
||||
FUN ADAPTER_FOR_FUN_INTERFACE_CONSTRUCTOR name:KConsumer visibility:local modality:FINAL <> (function:kotlin.Function1<@[ParameterName(name = 'x')] kotlin.String, kotlin.Unit>) returnType:<root>.KConsumer<kotlin.String>
|
||||
VALUE_PARAMETER ADAPTER_PARAMETER_FOR_CALLABLE_REFERENCE name:function index:0 type:kotlin.Function1<@[ParameterName(name = 'x')] kotlin.String, kotlin.Unit>
|
||||
EXPRESSION_BODY
|
||||
TYPE_OP type=<root>.KConsumer<kotlin.String> origin=SAM_CONVERSION typeOperand=<root>.KConsumer<kotlin.String>
|
||||
GET_VAR 'function: kotlin.Function1<@[ParameterName(name = 'x')] kotlin.String, kotlin.Unit> declared in <root>.test3a.KConsumer' type=kotlin.Function1<@[ParameterName(name = 'x')] kotlin.String, kotlin.Unit> origin=null
|
||||
FUNCTION_REFERENCE 'local final fun KConsumer (function: kotlin.Function1<@[ParameterName(name = 'x')] kotlin.String, kotlin.Unit>): <root>.KConsumer<kotlin.String> declared in <root>.test3a' type=kotlin.reflect.KFunction1<@[ParameterName(name = 'function')] kotlin.Function1<@[ParameterName(name = 'x')] kotlin.String, kotlin.Unit>, <root>.KConsumer<kotlin.String>> origin=FUN_INTERFACE_CONSTRUCTOR_REFERENCE reflectionTarget=<same>
|
||||
@@ -0,0 +1,36 @@
|
||||
// !LANGUAGE: +AllowKotlinFunInterfaceConstructorReference
|
||||
// WITH_REFLECT
|
||||
import kotlin.reflect.*
|
||||
|
||||
fun interface KRunnable {
|
||||
fun run()
|
||||
}
|
||||
|
||||
typealias KR = KRunnable
|
||||
|
||||
fun interface KSupplier<T> {
|
||||
fun get(): T
|
||||
}
|
||||
|
||||
typealias KSS = KSupplier<String>
|
||||
|
||||
fun interface KConsumer<T> {
|
||||
fun accept(x: T)
|
||||
}
|
||||
|
||||
typealias KCS = KConsumer<String>
|
||||
|
||||
fun test1() = ::KRunnable
|
||||
|
||||
fun test1a() = ::KR
|
||||
|
||||
fun test1b(): KFunction<Runnable> = ::Runnable
|
||||
|
||||
fun test2(): (() -> String) -> KSupplier<String> = ::KSupplier
|
||||
|
||||
fun test2a(): (() -> String) -> KSupplier<String> = ::KSS
|
||||
|
||||
fun test3(): ((String) -> Unit) -> KConsumer<String> = ::KConsumer
|
||||
|
||||
fun test3a(): ((String) -> Unit) -> KConsumer<String> = ::KCS
|
||||
|
||||
+74
@@ -0,0 +1,74 @@
|
||||
fun interface KRunnable {
|
||||
abstract fun run()
|
||||
|
||||
}
|
||||
|
||||
typealias KR = KRunnable
|
||||
fun interface KSupplier<T : Any?> {
|
||||
abstract fun get(): T
|
||||
|
||||
}
|
||||
|
||||
typealias KSS = KSupplier<String>
|
||||
fun interface KConsumer<T : Any?> {
|
||||
abstract fun accept(x: T)
|
||||
|
||||
}
|
||||
|
||||
typealias KCS = KConsumer<String>
|
||||
fun test1(): KFunction1<@ParameterName(name = "function") Function0<Unit>, KRunnable> {
|
||||
return { // BLOCK
|
||||
local fun KRunnable(fn: Function0<Unit>): KRunnable fn /*-> KRunnable */
|
||||
|
||||
::KRunnable
|
||||
}
|
||||
}
|
||||
|
||||
fun test1a(): KFunction1<@ParameterName(name = "function") Function0<Unit>, KRunnable> {
|
||||
return { // BLOCK
|
||||
local fun KRunnable(fn: Function0<Unit>): KRunnable fn /*-> KRunnable */
|
||||
|
||||
::KRunnable
|
||||
}
|
||||
}
|
||||
|
||||
fun test1b(): KFunction<Runnable> {
|
||||
return { // BLOCK
|
||||
local fun Runnable(fn: Function0<Unit>): Runnable fn /*-> Runnable */
|
||||
|
||||
::Runnable
|
||||
}
|
||||
}
|
||||
|
||||
fun test2(): Function1<Function0<String>, KSupplier<String>> {
|
||||
return { // BLOCK
|
||||
local fun KSupplier(fn: Function0<String>): KSupplier<String> fn /*-> KSupplier<String> */
|
||||
|
||||
::KSupplier
|
||||
}
|
||||
}
|
||||
|
||||
fun test2a(): Function1<Function0<String>, KSupplier<String>> {
|
||||
return { // BLOCK
|
||||
local fun KSupplier(fn: Function0<String>): KSupplier<String> fn /*-> KSupplier<String> */
|
||||
|
||||
::KSupplier
|
||||
}
|
||||
}
|
||||
|
||||
fun test3(): Function1<Function1<String, Unit>, KConsumer<String>> {
|
||||
return { // BLOCK
|
||||
local fun KConsumer(fn: Function1<@ParameterName(name = "x") String, Unit>): KConsumer<String> fn /*-> KConsumer<String> */
|
||||
|
||||
::KConsumer
|
||||
}
|
||||
}
|
||||
|
||||
fun test3a(): Function1<Function1<String, Unit>, KConsumer<String>> {
|
||||
return { // BLOCK
|
||||
local fun KConsumer(fn: Function1<@ParameterName(name = "x") String, Unit>): KConsumer<String> fn /*-> KConsumer<String> */
|
||||
|
||||
::KConsumer
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user