Add test checking that fun isn't inherited from base interface
This commit is contained in:
Generated
+5
@@ -7934,6 +7934,11 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirOldFronte
|
||||
runTest("compiler/testData/diagnostics/tests/funInterface/funInterfaceSyntheticConstructors.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("funIsNotInheritedFromBaseInterface.kt")
|
||||
public void testFunIsNotInheritedFromBaseInterface() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/funInterface/funIsNotInheritedFromBaseInterface.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("genericSubstitutionForFunInterface.kt")
|
||||
public void testGenericSubstitutionForFunInterface() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/funInterface/genericSubstitutionForFunInterface.kt");
|
||||
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
// !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
fun interface Base {
|
||||
fun invoke()
|
||||
}
|
||||
|
||||
interface WithoutFun : Base
|
||||
fun interface WithFun : Base
|
||||
|
||||
fun takeBase(b: Base) {}
|
||||
fun takeWithoutFun(a: WithoutFun) {}
|
||||
fun takeWithFun(a: WithFun) {}
|
||||
|
||||
fun test() {
|
||||
takeBase {}
|
||||
takeWithoutFun({})
|
||||
takeWithFun {}
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
// !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
fun interface Base {
|
||||
fun invoke()
|
||||
}
|
||||
|
||||
interface WithoutFun : Base
|
||||
fun interface WithFun : Base
|
||||
|
||||
fun takeBase(b: Base) {}
|
||||
fun takeWithoutFun(a: WithoutFun) {}
|
||||
fun takeWithFun(a: WithFun) {}
|
||||
|
||||
fun test() {
|
||||
takeBase {}
|
||||
takeWithoutFun(<!TYPE_MISMATCH!>{}<!>)
|
||||
takeWithFun {}
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
package
|
||||
|
||||
public fun takeBase(/*0*/ b: Base): kotlin.Unit
|
||||
public fun takeWithFun(/*0*/ a: WithFun): kotlin.Unit
|
||||
public fun takeWithoutFun(/*0*/ a: WithoutFun): kotlin.Unit
|
||||
public fun test(): kotlin.Unit
|
||||
|
||||
public fun interface Base {
|
||||
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 WithFun : Base {
|
||||
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(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public interface WithoutFun : Base {
|
||||
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(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
@@ -7941,6 +7941,11 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest {
|
||||
runTest("compiler/testData/diagnostics/tests/funInterface/funInterfaceSyntheticConstructors.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("funIsNotInheritedFromBaseInterface.kt")
|
||||
public void testFunIsNotInheritedFromBaseInterface() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/funInterface/funIsNotInheritedFromBaseInterface.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("genericSubstitutionForFunInterface.kt")
|
||||
public void testGenericSubstitutionForFunInterface() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/funInterface/genericSubstitutionForFunInterface.kt");
|
||||
|
||||
Generated
+5
@@ -7936,6 +7936,11 @@ public class DiagnosticsUsingJavacTestGenerated extends AbstractDiagnosticsUsing
|
||||
runTest("compiler/testData/diagnostics/tests/funInterface/funInterfaceSyntheticConstructors.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("funIsNotInheritedFromBaseInterface.kt")
|
||||
public void testFunIsNotInheritedFromBaseInterface() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/funInterface/funIsNotInheritedFromBaseInterface.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("genericSubstitutionForFunInterface.kt")
|
||||
public void testGenericSubstitutionForFunInterface() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/funInterface/genericSubstitutionForFunInterface.kt");
|
||||
|
||||
Reference in New Issue
Block a user