[JS FIR] Add JsName clash test
^KT-64364
This commit is contained in:
committed by
Space Team
parent
89e2af2047
commit
4609b11102
+15
@@ -0,0 +1,15 @@
|
|||||||
|
// !OPT_IN: kotlin.js.ExperimentalJsExport
|
||||||
|
// FIR_IDENTICAL
|
||||||
|
@file:JsExport
|
||||||
|
|
||||||
|
interface Optional<out T> {
|
||||||
|
@JsName("valueOrThrowException")
|
||||||
|
fun valueOrThrow(exp: Throwable): T
|
||||||
|
|
||||||
|
fun valueOrThrow(): T = valueOrThrow(NoSuchElementException("Optional has no value"))
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract class None<out T : Any> private constructor() : Optional<T> {
|
||||||
|
companion object : None<Nothing>()
|
||||||
|
override fun valueOrThrow(exp: Throwable): Nothing = throw exp
|
||||||
|
}
|
||||||
+27
@@ -0,0 +1,27 @@
|
|||||||
|
package
|
||||||
|
|
||||||
|
public abstract class None</*0*/ out T : kotlin.Any> : Optional<T> {
|
||||||
|
private constructor None</*0*/ out T : kotlin.Any>()
|
||||||
|
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 open override /*1*/ /*fake_override*/ fun valueOrThrow(): T
|
||||||
|
public open override /*1*/ fun valueOrThrow(/*0*/ exp: kotlin.Throwable): kotlin.Nothing
|
||||||
|
|
||||||
|
public companion object Companion : None<kotlin.Nothing> {
|
||||||
|
private constructor Companion()
|
||||||
|
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 open override /*1*/ /*fake_override*/ fun valueOrThrow(): kotlin.Nothing
|
||||||
|
public open override /*1*/ /*fake_override*/ fun valueOrThrow(/*0*/ exp: kotlin.Throwable): kotlin.Nothing
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface Optional</*0*/ out 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 open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||||
|
public open fun valueOrThrow(): T
|
||||||
|
@kotlin.js.JsName(name = "valueOrThrowException") public abstract fun valueOrThrow(/*0*/ exp: kotlin.Throwable): T
|
||||||
|
}
|
||||||
+6
@@ -688,6 +688,12 @@ public class FirPsiJsOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiJ
|
|||||||
runTest("compiler/testData/diagnostics/testsWithJsStdLib/name/classMembers.kt");
|
runTest("compiler/testData/diagnostics/testsWithJsStdLib/name/classMembers.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("companionInheritsOwnerClass.kt")
|
||||||
|
public void testCompanionInheritsOwnerClass() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/testsWithJsStdLib/name/companionInheritsOwnerClass.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("conflictingNamesFromSuperclass.kt")
|
@TestMetadata("conflictingNamesFromSuperclass.kt")
|
||||||
public void testConflictingNamesFromSuperclass() throws Exception {
|
public void testConflictingNamesFromSuperclass() throws Exception {
|
||||||
|
|||||||
Generated
+6
@@ -688,6 +688,12 @@ public class DiagnosticsWithJsStdLibTestGenerated extends AbstractDiagnosticsTes
|
|||||||
runTest("compiler/testData/diagnostics/testsWithJsStdLib/name/classMembers.kt");
|
runTest("compiler/testData/diagnostics/testsWithJsStdLib/name/classMembers.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("companionInheritsOwnerClass.kt")
|
||||||
|
public void testCompanionInheritsOwnerClass() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/testsWithJsStdLib/name/companionInheritsOwnerClass.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("conflictingNamesFromSuperclass.kt")
|
@TestMetadata("conflictingNamesFromSuperclass.kt")
|
||||||
public void testConflictingNamesFromSuperclass() throws Exception {
|
public void testConflictingNamesFromSuperclass() throws Exception {
|
||||||
|
|||||||
Reference in New Issue
Block a user