Fix missing error on fun interface constructor reference
#KT-51843 Fixed
This commit is contained in:
+2
-2
@@ -16,7 +16,7 @@ object FunInterfaceConstructorReferenceChecker : CallChecker {
|
||||
override fun check(resolvedCall: ResolvedCall<*>, reportOn: PsiElement, context: CallCheckerContext) {
|
||||
if (context.languageVersionSettings.supportsFeature(LanguageFeature.KotlinFunInterfaceConstructorReference)) return
|
||||
|
||||
val resultingDescriptor = resolvedCall.resultingDescriptor
|
||||
val resultingDescriptor = resolvedCall.resultingDescriptor.original
|
||||
if (resultingDescriptor !is SamConstructorDescriptor || !resolvedCall.call.isCallableReference()) return
|
||||
|
||||
if (resultingDescriptor.baseDescriptorForSynthetic.isFun) {
|
||||
@@ -25,4 +25,4 @@ object FunInterfaceConstructorReferenceChecker : CallChecker {
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+3
@@ -8,3 +8,6 @@ fun interface Foo {
|
||||
val x = ::Foo
|
||||
val y = Foo { }
|
||||
val z = ::<!JAVA_SAM_INTERFACE_CONSTRUCTOR_REFERENCE!>Runnable<!>
|
||||
val w = id(::Foo)
|
||||
|
||||
fun <T> id(t: T): T = t
|
||||
|
||||
Vendored
+3
@@ -1,8 +1,10 @@
|
||||
package
|
||||
|
||||
public val w: kotlin.reflect.KFunction1<() -> kotlin.Unit, Foo>
|
||||
public val x: kotlin.reflect.KFunction1<() -> kotlin.Unit, Foo>
|
||||
public val y: Foo
|
||||
public val z: kotlin.reflect.KFunction1<() -> kotlin.Unit, java.lang.Runnable>
|
||||
public fun </*0*/ T> id(/*0*/ t: T): T
|
||||
|
||||
public fun interface Foo {
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
@@ -10,3 +12,4 @@ public fun interface Foo {
|
||||
public abstract fun run(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
|
||||
Vendored
+3
@@ -8,3 +8,6 @@ fun interface Foo {
|
||||
val x = ::<!FUN_INTERFACE_CONSTRUCTOR_REFERENCE!>Foo<!>
|
||||
val y = Foo { }
|
||||
val z = ::<!JAVA_SAM_INTERFACE_CONSTRUCTOR_REFERENCE!>Runnable<!>
|
||||
val w = id(::<!FUN_INTERFACE_CONSTRUCTOR_REFERENCE!>Foo<!>)
|
||||
|
||||
fun <T> id(t: T): T = t
|
||||
|
||||
Vendored
+3
@@ -1,8 +1,10 @@
|
||||
package
|
||||
|
||||
public val w: kotlin.reflect.KFunction1<() -> kotlin.Unit, Foo>
|
||||
public val x: kotlin.reflect.KFunction1<() -> kotlin.Unit, Foo>
|
||||
public val y: Foo
|
||||
public val z: kotlin.reflect.KFunction1<() -> kotlin.Unit, java.lang.Runnable>
|
||||
public fun </*0*/ T> id(/*0*/ t: T): T
|
||||
|
||||
public fun interface Foo {
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
@@ -10,3 +12,4 @@ public fun interface Foo {
|
||||
public abstract fun run(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user