Files
kotlin-fork/compiler/testData/diagnostics/tests/funInterface/funInterfaceConstructorReferences_after.kt
T
Dmitry Petrov 1fd0dec5e7 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.
2021-12-08 14:12:33 +03:00

11 lines
256 B
Kotlin
Vendored

// FIR_IDENTICAL
// !LANGUAGE: +AllowKotlinFunInterfaceConstructorReference +ProhibitJavaSamInterfaceConstructorReference
fun interface Foo {
fun run()
}
val x = ::Foo
val y = Foo { }
val z = ::<!JAVA_SAM_INTERFACE_CONSTRUCTOR_REFERENCE!>Runnable<!>