-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Proper check NON_JVM_DEFAULT_OVERRIDES_JAVA_DEFAULT in new jvm-defaul…
…t modes #KT-42699 Fixed (cherry picked from commit c8e84f8)
- Loading branch information
Mikhael Bogdanov
committed
Oct 15, 2020
1 parent
43ee55b
commit a9e0002
Showing
8 changed files
with
166 additions
and
7 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
...ests/tests/org/jetbrains/kotlin/fir/FirOldFrontendDiagnosticsTestWithStdlibGenerated.java
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 70 additions & 0 deletions
70
compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/javaOverrideAll.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
// FIR_IDENTICAL | ||
// !JVM_DEFAULT_MODE: all | ||
// !JVM_TARGET: 1.8 | ||
|
||
// FILE: JavaInterface.java | ||
public interface JavaInterface { | ||
default void test() {} | ||
|
||
default void testForNonDefault() {} | ||
|
||
void testAbstract(); | ||
} | ||
|
||
// FILE: 1.kt | ||
|
||
interface KotlinInterface : JavaInterface { | ||
@JvmDefault | ||
override fun test() {} | ||
|
||
override fun testForNonDefault() {} | ||
|
||
override fun testAbstract() {} | ||
} | ||
|
||
interface KotlinInterface2 : JavaInterface, KotlinInterface { | ||
override fun test() {} | ||
|
||
override fun testForNonDefault() {} | ||
|
||
override fun testAbstract() {} | ||
} | ||
|
||
|
||
interface KotlinInterfaceForIndirect : JavaInterface { | ||
|
||
} | ||
|
||
interface KotlinInterfaceIndirectInheritance : KotlinInterfaceForIndirect { | ||
|
||
override fun test() {} | ||
|
||
override fun testForNonDefault() {} | ||
|
||
override fun testAbstract() {} | ||
} | ||
|
||
open class KotlinClass : JavaInterface { | ||
override fun test() {} | ||
|
||
override fun testForNonDefault() {} | ||
|
||
override fun testAbstract() {} | ||
} | ||
|
||
interface KotlinInterfaceX { | ||
|
||
fun test() {} | ||
|
||
fun testForNonDefault() {} | ||
|
||
fun testAbstract() {} | ||
} | ||
|
||
interface KotlinInterfaceManySuper: JavaInterface, KotlinInterfaceX { | ||
override fun test() {} | ||
|
||
override fun testForNonDefault() {} | ||
|
||
override fun testAbstract() {} | ||
} |
74 changes: 74 additions & 0 deletions
74
compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/javaOverrideAll.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
package | ||
|
||
public interface JavaInterface { | ||
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 test(): kotlin.Unit | ||
public abstract fun testAbstract(): kotlin.Unit | ||
public open fun testForNonDefault(): kotlin.Unit | ||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String | ||
} | ||
|
||
public open class KotlinClass : JavaInterface { | ||
public constructor KotlinClass() | ||
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*/ fun test(): kotlin.Unit | ||
public open override /*1*/ fun testAbstract(): kotlin.Unit | ||
public open override /*1*/ fun testForNonDefault(): kotlin.Unit | ||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String | ||
} | ||
|
||
public interface KotlinInterface : JavaInterface { | ||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean | ||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int | ||
@kotlin.jvm.JvmDefault public open override /*1*/ fun test(): kotlin.Unit | ||
public open override /*1*/ fun testAbstract(): kotlin.Unit | ||
public open override /*1*/ fun testForNonDefault(): kotlin.Unit | ||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String | ||
} | ||
|
||
public interface KotlinInterface2 : JavaInterface, KotlinInterface { | ||
public open override /*2*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean | ||
public open override /*2*/ /*fake_override*/ fun hashCode(): kotlin.Int | ||
public open override /*2*/ fun test(): kotlin.Unit | ||
public open override /*2*/ fun testAbstract(): kotlin.Unit | ||
public open override /*2*/ fun testForNonDefault(): kotlin.Unit | ||
public open override /*2*/ /*fake_override*/ fun toString(): kotlin.String | ||
} | ||
|
||
public interface KotlinInterfaceForIndirect : JavaInterface { | ||
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 test(): kotlin.Unit | ||
public abstract override /*1*/ /*fake_override*/ fun testAbstract(): kotlin.Unit | ||
public open override /*1*/ /*fake_override*/ fun testForNonDefault(): kotlin.Unit | ||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String | ||
} | ||
|
||
public interface KotlinInterfaceIndirectInheritance : KotlinInterfaceForIndirect { | ||
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*/ fun test(): kotlin.Unit | ||
public open override /*1*/ fun testAbstract(): kotlin.Unit | ||
public open override /*1*/ fun testForNonDefault(): kotlin.Unit | ||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String | ||
} | ||
|
||
public interface KotlinInterfaceManySuper : JavaInterface, KotlinInterfaceX { | ||
public open override /*2*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean | ||
public open override /*2*/ /*fake_override*/ fun hashCode(): kotlin.Int | ||
public open override /*2*/ fun test(): kotlin.Unit | ||
public open override /*2*/ fun testAbstract(): kotlin.Unit | ||
public open override /*2*/ fun testForNonDefault(): kotlin.Unit | ||
public open override /*2*/ /*fake_override*/ fun toString(): kotlin.String | ||
} | ||
|
||
public interface KotlinInterfaceX { | ||
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 test(): kotlin.Unit | ||
public open fun testAbstract(): kotlin.Unit | ||
public open fun testForNonDefault(): kotlin.Unit | ||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String | ||
} |
5 changes: 5 additions & 0 deletions
5
compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestWithStdLibGenerated.java
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
...sts/org/jetbrains/kotlin/checkers/javac/DiagnosticsTestWithStdLibUsingJavacGenerated.java
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
10 changes: 5 additions & 5 deletions
10
compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.