FE KT-47939 callable references to functional interface constructors

Allow callable references to Kotlin 'fun interface' constructors.
Prohibit callable references to Java SAM interface constructors.
This commit is contained in:
Dmitry Petrov
2021-11-29 15:10:14 +03:00
committed by TeamCityServer
parent bfb6e73728
commit 1fd0dec5e7
26 changed files with 188 additions and 43 deletions
@@ -0,0 +1,10 @@
// FIR_IDENTICAL
// !LANGUAGE: +AllowKotlinFunInterfaceConstructorReference +ProhibitJavaSamInterfaceConstructorReference
fun interface Foo {
fun run()
}
val x = ::Foo
val y = Foo { }
val z = ::<!JAVA_SAM_INTERFACE_CONSTRUCTOR_REFERENCE!>Runnable<!>