Add base declaration checker for fun interfaces
This commit is contained in:
Generated
+5
@@ -7924,6 +7924,11 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirOldFronte
|
||||
runTest("compiler/testData/diagnostics/tests/funInterface/basicFunInterfaceDisabled.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("funInterfaceDeclarationCheck.kt")
|
||||
public void testFunInterfaceDeclarationCheck() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/funInterface/funInterfaceDeclarationCheck.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("funInterfaceSyntheticConstructors.kt")
|
||||
public void testFunInterfaceSyntheticConstructors() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/funInterface/funInterfaceSyntheticConstructors.kt");
|
||||
|
||||
@@ -360,6 +360,13 @@ public interface Errors {
|
||||
DiagnosticFactory0<PsiElement> RESULT_CLASS_IN_RETURN_TYPE = DiagnosticFactory0.create(ERROR);
|
||||
DiagnosticFactory1<PsiElement, String> RESULT_CLASS_WITH_NULLABLE_OPERATOR = DiagnosticFactory1.create(ERROR);
|
||||
|
||||
// Fun interfaces
|
||||
|
||||
DiagnosticFactory0<PsiElement> FUN_INTERFACE_WRONG_COUNT_OF_ABSTRACT_MEMBERS = DiagnosticFactory0.create(ERROR);
|
||||
DiagnosticFactory0<PsiElement> FUN_INTERFACE_CANNOT_HAVE_ABSTRACT_PROPERTIES = DiagnosticFactory0.create(ERROR);
|
||||
DiagnosticFactory0<PsiElement> FUN_INTERFACE_ABSTRACT_METHOD_WITH_TYPE_PARAMETERS = DiagnosticFactory0.create(ERROR);
|
||||
DiagnosticFactory0<PsiElement> FUN_INTERFACE_ABSTRACT_METHOD_WITH_DEFAULT_VALUE = DiagnosticFactory0.create(ERROR);
|
||||
|
||||
// Secondary constructors
|
||||
|
||||
DiagnosticFactory0<KtConstructorDelegationReferenceExpression> CYCLIC_CONSTRUCTOR_DELEGATION_CALL = DiagnosticFactory0.create(ERROR);
|
||||
|
||||
+5
@@ -700,6 +700,11 @@ public class DefaultErrorMessages {
|
||||
MAP.put(RESULT_CLASS_IN_RETURN_TYPE, "'kotlin.Result' cannot be used as a return type");
|
||||
MAP.put(RESULT_CLASS_WITH_NULLABLE_OPERATOR, "Expression of type 'kotlin.Result' cannot be used as a left operand of ''{0}''", STRING);
|
||||
|
||||
MAP.put(FUN_INTERFACE_WRONG_COUNT_OF_ABSTRACT_MEMBERS, "Fun interfaces must have exactly one abstract method");
|
||||
MAP.put(FUN_INTERFACE_CANNOT_HAVE_ABSTRACT_PROPERTIES, "Fun interfaces cannot have abstract properties");
|
||||
MAP.put(FUN_INTERFACE_ABSTRACT_METHOD_WITH_TYPE_PARAMETERS, "Single abstract member cannot declare type parameters");
|
||||
MAP.put(FUN_INTERFACE_ABSTRACT_METHOD_WITH_DEFAULT_VALUE, "Single abstract member cannot declare default values");
|
||||
|
||||
MAP.put(VARIANCE_ON_TYPE_PARAMETER_NOT_ALLOWED, "Variance annotations are only allowed for type parameters of classes and interfaces");
|
||||
MAP.put(BOUND_ON_TYPE_ALIAS_PARAMETER_NOT_ALLOWED, "Bounds are not allowed on type alias parameters");
|
||||
|
||||
|
||||
@@ -35,7 +35,8 @@ private val DEFAULT_DECLARATION_CHECKERS = listOf(
|
||||
ExplicitApiDeclarationChecker(),
|
||||
TailrecFunctionChecker,
|
||||
TrailingCommaDeclarationChecker,
|
||||
MissingDependencySupertypeChecker.ForDeclarations
|
||||
MissingDependencySupertypeChecker.ForDeclarations,
|
||||
FunInterfaceDeclarationChecker()
|
||||
)
|
||||
|
||||
private val DEFAULT_CALL_CHECKERS = listOf(
|
||||
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
/*
|
||||
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.resolve.checkers
|
||||
|
||||
import com.intellij.psi.PsiElement
|
||||
import org.jetbrains.kotlin.descriptors.*
|
||||
import org.jetbrains.kotlin.diagnostics.Errors
|
||||
import org.jetbrains.kotlin.psi.*
|
||||
import org.jetbrains.kotlin.resolve.calls.components.hasDefaultValue
|
||||
import org.jetbrains.kotlin.resolve.sam.getAbstractMembers
|
||||
import org.jetbrains.kotlin.resolve.source.getPsi
|
||||
|
||||
class FunInterfaceDeclarationChecker : DeclarationChecker {
|
||||
override fun check(declaration: KtDeclaration, descriptor: DeclarationDescriptor, context: DeclarationCheckerContext) {
|
||||
if (declaration !is KtClass) return
|
||||
if (descriptor !is ClassDescriptor || !descriptor.isFun) return
|
||||
|
||||
val funKeyword = declaration.getFunKeyword() ?: return
|
||||
|
||||
val abstractMembers = getAbstractMembers(descriptor)
|
||||
for (abstractMember in abstractMembers) {
|
||||
if (abstractMember !is PropertyDescriptor) continue
|
||||
|
||||
val reportOnProperty = abstractMember.containingDeclaration == descriptor
|
||||
val reportOn = if (reportOnProperty) {
|
||||
(abstractMember.source.getPsi() as? KtProperty)?.valOrVarKeyword ?: funKeyword
|
||||
} else {
|
||||
funKeyword
|
||||
}
|
||||
|
||||
context.trace.report(Errors.FUN_INTERFACE_CANNOT_HAVE_ABSTRACT_PROPERTIES.on(reportOn))
|
||||
|
||||
if (!reportOnProperty) return // It's enough to report only once if abstract properties are in the base class
|
||||
}
|
||||
|
||||
val abstractMember = abstractMembers.filterIsInstance<FunctionDescriptor>().singleOrNull()
|
||||
|
||||
if (abstractMember == null) {
|
||||
context.trace.report(Errors.FUN_INTERFACE_WRONG_COUNT_OF_ABSTRACT_MEMBERS.on(funKeyword))
|
||||
return
|
||||
}
|
||||
|
||||
checkSingleAbstractMember(abstractMember, funKeyword, context)
|
||||
}
|
||||
|
||||
private fun checkSingleAbstractMember(
|
||||
abstractMember: FunctionDescriptor,
|
||||
funInterfaceKeyword: PsiElement,
|
||||
context: DeclarationCheckerContext,
|
||||
) {
|
||||
val ktFunction = abstractMember.source.getPsi() as? KtNamedFunction
|
||||
if (abstractMember.typeParameters.isNotEmpty()) {
|
||||
val reportOn = ktFunction?.typeParameterList ?: ktFunction?.funKeyword ?: funInterfaceKeyword
|
||||
context.trace.report(Errors.FUN_INTERFACE_ABSTRACT_METHOD_WITH_TYPE_PARAMETERS.on(reportOn))
|
||||
return
|
||||
}
|
||||
|
||||
for (parameter in abstractMember.valueParameters) {
|
||||
if (parameter.hasDefaultValue()) {
|
||||
val reportOn = parameter.source.getPsi() ?: ktFunction?.funKeyword ?: funInterfaceKeyword
|
||||
context.trace.report(Errors.FUN_INTERFACE_ABSTRACT_METHOD_WITH_DEFAULT_VALUE.on(reportOn))
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -40,6 +40,8 @@ open class KtClass : KtClassOrObject {
|
||||
fun getClassOrInterfaceKeyword(): PsiElement? = findChildByType(TokenSet.create(KtTokens.CLASS_KEYWORD, KtTokens.INTERFACE_KEYWORD))
|
||||
|
||||
fun getClassKeyword(): PsiElement? = findChildByType(KtTokens.CLASS_KEYWORD)
|
||||
|
||||
fun getFunKeyword(): PsiElement? = modifierList?.getModifier(KtTokens.FUN_KEYWORD)
|
||||
}
|
||||
|
||||
fun KtClass.createPrimaryConstructorIfAbsent(): KtPrimaryConstructor {
|
||||
|
||||
+104
@@ -0,0 +1,104 @@
|
||||
// !LANGUAGE: +FunctionalInterfaceConversion
|
||||
|
||||
fun interface Good {
|
||||
fun invoke()
|
||||
}
|
||||
|
||||
fun interface Foo1
|
||||
|
||||
fun interface Foo2 {
|
||||
|
||||
}
|
||||
|
||||
fun interface Foo3 {
|
||||
fun foo()
|
||||
fun bar()
|
||||
}
|
||||
|
||||
interface BaseWithSAM {
|
||||
fun base()
|
||||
}
|
||||
|
||||
fun interface Foo4 : BaseWithSAM {
|
||||
fun oneMore()
|
||||
}
|
||||
|
||||
fun interface Foo4WithDefault : BaseWithSAM {
|
||||
fun oneMore() {}
|
||||
}
|
||||
|
||||
interface BaseWithDefault {
|
||||
fun def() {}
|
||||
}
|
||||
|
||||
fun interface Foo4WithBaseDefault : BaseWithDefault {
|
||||
fun oneMore()
|
||||
}
|
||||
|
||||
fun interface GoodWithBase : BaseWithSAM
|
||||
|
||||
fun interface Foo5 {
|
||||
val prop: Int
|
||||
}
|
||||
|
||||
fun interface Foo6 {
|
||||
fun foo()
|
||||
val prop: Int
|
||||
}
|
||||
|
||||
fun interface Foo7 : BaseWithSAM {
|
||||
val prop: Int
|
||||
}
|
||||
|
||||
fun interface GoodWithPropAndBase : BaseWithSAM {
|
||||
val prop: Int get() = 42
|
||||
}
|
||||
|
||||
fun interface Foo8 {
|
||||
fun <T> invoke(x: T)
|
||||
}
|
||||
|
||||
fun interface GoodGeneric<T> {
|
||||
fun invoke(x: T)
|
||||
}
|
||||
|
||||
interface BaseWithGeneric {
|
||||
fun <T> invoke(x: T)
|
||||
}
|
||||
|
||||
fun interface Foo9 : BaseWithGeneric
|
||||
|
||||
fun interface GoodExtensionGeneric : GoodGeneric<String>
|
||||
|
||||
fun interface GoodSuspend {
|
||||
suspend fun invoke()
|
||||
}
|
||||
|
||||
class WithNestedFun<K> {
|
||||
fun interface NestedSimple
|
||||
|
||||
fun interface GoodFun {
|
||||
fun invoke()
|
||||
}
|
||||
|
||||
fun interface NestedFun {
|
||||
fun inovke(element: K)
|
||||
}
|
||||
}
|
||||
|
||||
fun <T> local() {
|
||||
fun interface LocalFun {
|
||||
fun invoke(element: T)
|
||||
}
|
||||
}
|
||||
|
||||
fun interface WithDefaultValue {
|
||||
fun invoke(s: String = "")
|
||||
}
|
||||
|
||||
interface BaseWithDefaultValue {
|
||||
fun invoke(s: String = "")
|
||||
}
|
||||
|
||||
fun interface DeriveDefault : BaseWithDefaultValue
|
||||
|
||||
+103
@@ -0,0 +1,103 @@
|
||||
// !LANGUAGE: +FunctionalInterfaceConversion
|
||||
|
||||
fun interface Good {
|
||||
fun invoke()
|
||||
}
|
||||
|
||||
<!FUN_INTERFACE_WRONG_COUNT_OF_ABSTRACT_MEMBERS!>fun<!> interface Foo1
|
||||
|
||||
<!FUN_INTERFACE_WRONG_COUNT_OF_ABSTRACT_MEMBERS!>fun<!> interface Foo2 {
|
||||
|
||||
}
|
||||
|
||||
<!FUN_INTERFACE_WRONG_COUNT_OF_ABSTRACT_MEMBERS!>fun<!> interface Foo3 {
|
||||
fun foo()
|
||||
fun bar()
|
||||
}
|
||||
|
||||
interface BaseWithSAM {
|
||||
fun base()
|
||||
}
|
||||
|
||||
<!FUN_INTERFACE_WRONG_COUNT_OF_ABSTRACT_MEMBERS!>fun<!> interface Foo4 : BaseWithSAM {
|
||||
fun oneMore()
|
||||
}
|
||||
|
||||
fun interface Foo4WithDefault : BaseWithSAM {
|
||||
fun oneMore() {}
|
||||
}
|
||||
|
||||
interface BaseWithDefault {
|
||||
fun def() {}
|
||||
}
|
||||
|
||||
fun interface Foo4WithBaseDefault : BaseWithDefault {
|
||||
fun oneMore()
|
||||
}
|
||||
|
||||
fun interface GoodWithBase : BaseWithSAM
|
||||
|
||||
<!FUN_INTERFACE_WRONG_COUNT_OF_ABSTRACT_MEMBERS!>fun<!> interface Foo5 {
|
||||
<!FUN_INTERFACE_CANNOT_HAVE_ABSTRACT_PROPERTIES!>val<!> prop: Int
|
||||
}
|
||||
|
||||
fun interface Foo6 {
|
||||
fun foo()
|
||||
<!FUN_INTERFACE_CANNOT_HAVE_ABSTRACT_PROPERTIES!>val<!> prop: Int
|
||||
}
|
||||
|
||||
fun interface Foo7 : BaseWithSAM {
|
||||
<!FUN_INTERFACE_CANNOT_HAVE_ABSTRACT_PROPERTIES!>val<!> prop: Int
|
||||
}
|
||||
|
||||
fun interface GoodWithPropAndBase : BaseWithSAM {
|
||||
val prop: Int get() = 42
|
||||
}
|
||||
|
||||
fun interface Foo8 {
|
||||
fun <!FUN_INTERFACE_ABSTRACT_METHOD_WITH_TYPE_PARAMETERS!><T><!> invoke(x: T)
|
||||
}
|
||||
|
||||
fun interface GoodGeneric<T> {
|
||||
fun invoke(x: T)
|
||||
}
|
||||
|
||||
interface BaseWithGeneric {
|
||||
fun <T> invoke(x: T)
|
||||
}
|
||||
|
||||
<!FUN_INTERFACE_ABSTRACT_METHOD_WITH_TYPE_PARAMETERS!>fun<!> interface Foo9 : BaseWithGeneric
|
||||
|
||||
fun interface GoodExtensionGeneric : GoodGeneric<String>
|
||||
|
||||
fun interface GoodSuspend {
|
||||
suspend fun invoke()
|
||||
}
|
||||
|
||||
class WithNestedFun<K> {
|
||||
<!FUN_INTERFACE_WRONG_COUNT_OF_ABSTRACT_MEMBERS!>fun<!> interface NestedSimple
|
||||
|
||||
fun interface GoodFun {
|
||||
fun invoke()
|
||||
}
|
||||
|
||||
fun interface NestedFun {
|
||||
fun inovke(element: <!UNRESOLVED_REFERENCE!>K<!>)
|
||||
}
|
||||
}
|
||||
|
||||
fun <T> local() {
|
||||
<!LOCAL_INTERFACE_NOT_ALLOWED!>fun interface LocalFun<!> {
|
||||
fun invoke(element: T)
|
||||
}
|
||||
}
|
||||
|
||||
fun interface WithDefaultValue {
|
||||
fun invoke(<!FUN_INTERFACE_ABSTRACT_METHOD_WITH_DEFAULT_VALUE!>s: String = ""<!>)
|
||||
}
|
||||
|
||||
interface BaseWithDefaultValue {
|
||||
fun invoke(s: String = "")
|
||||
}
|
||||
|
||||
<!FUN_INTERFACE_ABSTRACT_METHOD_WITH_DEFAULT_VALUE!>fun<!> interface DeriveDefault : BaseWithDefaultValue
|
||||
+196
@@ -0,0 +1,196 @@
|
||||
package
|
||||
|
||||
public fun </*0*/ T> local(): kotlin.Unit
|
||||
|
||||
public interface BaseWithDefault {
|
||||
public open fun def(): kotlin.Unit
|
||||
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
|
||||
}
|
||||
|
||||
public interface BaseWithDefaultValue {
|
||||
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 abstract fun invoke(/*0*/ s: kotlin.String = ...): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public interface BaseWithGeneric {
|
||||
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 abstract fun </*0*/ T> invoke(/*0*/ x: T): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public interface BaseWithSAM {
|
||||
public abstract fun base(): kotlin.Unit
|
||||
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
|
||||
}
|
||||
|
||||
public fun interface DeriveDefault : BaseWithDefaultValue {
|
||||
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 abstract override /*1*/ /*fake_override*/ fun invoke(/*0*/ s: kotlin.String = ...): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public fun interface Foo1 {
|
||||
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
|
||||
}
|
||||
|
||||
public fun interface Foo2 {
|
||||
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
|
||||
}
|
||||
|
||||
public fun interface Foo3 {
|
||||
public abstract fun bar(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public abstract fun foo(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public fun interface Foo4 : BaseWithSAM {
|
||||
public abstract override /*1*/ /*fake_override*/ fun base(): kotlin.Unit
|
||||
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 abstract fun oneMore(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public fun interface Foo4WithBaseDefault : BaseWithDefault {
|
||||
public open override /*1*/ /*fake_override*/ fun def(): kotlin.Unit
|
||||
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 abstract fun oneMore(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public fun interface Foo4WithDefault : BaseWithSAM {
|
||||
public abstract override /*1*/ /*fake_override*/ fun base(): kotlin.Unit
|
||||
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 fun oneMore(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public fun interface Foo5 {
|
||||
public abstract val prop: 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
|
||||
}
|
||||
|
||||
public fun interface Foo6 {
|
||||
public abstract val prop: kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public abstract fun foo(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public fun interface Foo7 : BaseWithSAM {
|
||||
public abstract val prop: kotlin.Int
|
||||
public abstract override /*1*/ /*fake_override*/ fun base(): kotlin.Unit
|
||||
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
|
||||
}
|
||||
|
||||
public fun interface Foo8 {
|
||||
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 abstract fun </*0*/ T> invoke(/*0*/ x: T): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public fun interface Foo9 : BaseWithGeneric {
|
||||
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 abstract override /*1*/ /*fake_override*/ fun </*0*/ T> invoke(/*0*/ x: T): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public fun interface Good {
|
||||
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 abstract fun invoke(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public fun interface GoodExtensionGeneric : GoodGeneric<kotlin.String> {
|
||||
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 abstract override /*1*/ /*fake_override*/ fun invoke(/*0*/ x: kotlin.String): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public fun interface GoodGeneric</*0*/ T> {
|
||||
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 abstract fun invoke(/*0*/ x: T): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public fun interface GoodSuspend {
|
||||
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 abstract suspend fun invoke(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public fun interface GoodWithBase : BaseWithSAM {
|
||||
public abstract override /*1*/ /*fake_override*/ fun base(): kotlin.Unit
|
||||
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
|
||||
}
|
||||
|
||||
public fun interface GoodWithPropAndBase : BaseWithSAM {
|
||||
public open val prop: kotlin.Int
|
||||
public abstract override /*1*/ /*fake_override*/ fun base(): kotlin.Unit
|
||||
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
|
||||
}
|
||||
|
||||
public fun interface WithDefaultValue {
|
||||
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 abstract fun invoke(/*0*/ s: kotlin.String = ...): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public final class WithNestedFun</*0*/ K> {
|
||||
public constructor WithNestedFun</*0*/ K>()
|
||||
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
|
||||
|
||||
public fun interface GoodFun {
|
||||
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 abstract fun invoke(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public fun interface NestedFun {
|
||||
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 abstract fun inovke(/*0*/ element: [ERROR : K]): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public fun interface NestedSimple {
|
||||
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
|
||||
}
|
||||
}
|
||||
@@ -7931,6 +7931,11 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest {
|
||||
runTest("compiler/testData/diagnostics/tests/funInterface/basicFunInterfaceDisabled.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("funInterfaceDeclarationCheck.kt")
|
||||
public void testFunInterfaceDeclarationCheck() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/funInterface/funInterfaceDeclarationCheck.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("funInterfaceSyntheticConstructors.kt")
|
||||
public void testFunInterfaceSyntheticConstructors() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/funInterface/funInterfaceSyntheticConstructors.kt");
|
||||
|
||||
Generated
+5
@@ -7926,6 +7926,11 @@ public class DiagnosticsUsingJavacTestGenerated extends AbstractDiagnosticsUsing
|
||||
runTest("compiler/testData/diagnostics/tests/funInterface/basicFunInterfaceDisabled.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("funInterfaceDeclarationCheck.kt")
|
||||
public void testFunInterfaceDeclarationCheck() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/funInterface/funInterfaceDeclarationCheck.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("funInterfaceSyntheticConstructors.kt")
|
||||
public void testFunInterfaceSyntheticConstructors() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/funInterface/funInterfaceSyntheticConstructors.kt");
|
||||
|
||||
Reference in New Issue
Block a user