[PL] ABI compatibility tests for reworked partial linkage
This commit is contained in:
committed by
Space Team
parent
2a4d880037
commit
4f1155b06f
+114
-47
@@ -2,25 +2,40 @@
|
||||
|
||||
package abitestutils
|
||||
|
||||
import abitestutils.ThrowableKind.*
|
||||
import abitestutils.TestMode.*
|
||||
|
||||
/** API **/
|
||||
/** Public API **/
|
||||
|
||||
interface TestBuilder {
|
||||
fun prefixed(prefix: String): ErrorMessagePattern
|
||||
fun nonImplementedCallable(callableTypeAndName: String, classifierTypeAndName: String): ErrorMessagePattern
|
||||
val testMode: TestMode
|
||||
|
||||
fun expectFailure(errorMessagePattern: ErrorMessagePattern, block: Block<Any?>)
|
||||
/** N.B. It is expected that [messageWithoutHashes] contains IR linkage error message without hashes in ID signatures. */
|
||||
fun linkage(messageWithoutHashes: String): FailurePattern
|
||||
fun nonImplementedCallable(callableTypeAndName: String, classifierTypeAndName: String): FailurePattern
|
||||
fun noWhenBranch(): FailurePattern
|
||||
fun custom(checker: (Throwable) -> Boolean): FailurePattern
|
||||
|
||||
fun expectFailure(failurePattern: FailurePattern, block: Block<Any?>)
|
||||
fun expectSuccess(block: Block<String>) // OK is expected
|
||||
fun <T : Any> expectSuccess(expectedOutcome: T, block: Block<T>)
|
||||
}
|
||||
|
||||
const val OK_STATUS = "OK"
|
||||
|
||||
sealed interface ErrorMessagePattern
|
||||
sealed interface FailurePattern
|
||||
|
||||
private typealias Block<T> = () -> T
|
||||
|
||||
enum class TestMode(val isJs: Boolean = false, val isNative: Boolean = false) {
|
||||
JS_NO_IC(isJs = true),
|
||||
JS_WITH_IC(isJs = true),
|
||||
NATIVE_CACHE_NO(isNative = true),
|
||||
NATIVE_CACHE_STATIC_ONLY_DIST(isNative = true),
|
||||
NATIVE_CACHE_STATIC_EVERYWHERE(isNative = true);
|
||||
|
||||
init {
|
||||
check(isJs xor isNative)
|
||||
}
|
||||
}
|
||||
|
||||
fun abiTest(init: TestBuilder.() -> Unit): String {
|
||||
val builder = TestBuilderImpl()
|
||||
builder.init()
|
||||
@@ -30,16 +45,23 @@ fun abiTest(init: TestBuilder.() -> Unit): String {
|
||||
|
||||
/** Implementation **/
|
||||
|
||||
private const val OK_STATUS = "OK"
|
||||
|
||||
private class TestBuilderImpl : TestBuilder {
|
||||
override val testMode = TestMode.__UNKNOWN__
|
||||
|
||||
private val tests = mutableListOf<Test>()
|
||||
|
||||
override fun prefixed(prefix: String) = PrefixOfErrorMessage(prefix)
|
||||
override fun linkage(messageWithoutHashes: String) = GeneralIrLinkageError(messageWithoutHashes)
|
||||
|
||||
override fun nonImplementedCallable(callableTypeAndName: String, classifierTypeAndName: String) =
|
||||
NonImplementedCallable(callableTypeAndName, classifierTypeAndName)
|
||||
NonImplementedCallableIrLinkageError(callableTypeAndName, classifierTypeAndName)
|
||||
|
||||
override fun expectFailure(errorMessagePattern: ErrorMessagePattern, block: Block<Any?>) {
|
||||
tests += FailingTest(errorMessagePattern, block)
|
||||
override fun noWhenBranch() = NoWhenBranchFailure
|
||||
override fun custom(checker: (Throwable) -> Boolean) = CustomThrowableFailure(checker)
|
||||
|
||||
override fun expectFailure(failurePattern: FailurePattern, block: Block<Any?>) {
|
||||
tests += FailingTest(failurePattern as AbstractFailurePattern, block)
|
||||
}
|
||||
|
||||
override fun expectSuccess(block: Block<String>) = expectSuccess(OK_STATUS, block)
|
||||
@@ -57,14 +79,10 @@ private class TestBuilderImpl : TestBuilder {
|
||||
val testFailureDetails: TestFailureDetails? = when (test) {
|
||||
is FailingTest -> {
|
||||
try {
|
||||
test.block()
|
||||
TestSuccessfulButMustFail
|
||||
val result = test.block()
|
||||
TestSuccessfulButMustFail(result)
|
||||
} catch (t: Throwable) {
|
||||
when (t.throwableKind) {
|
||||
IR_LINKAGE_ERROR -> test.checkIrLinkageErrorMessage(t)
|
||||
EXCEPTION -> TestFailedWithException(t)
|
||||
NON_EXCEPTION -> throw t // Something totally unexpected. Rethrow.
|
||||
}
|
||||
test.failurePattern.validateFailure(t)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,40 +94,52 @@ private class TestBuilderImpl : TestBuilder {
|
||||
else
|
||||
TestMismatchedExpectation(test.expectedOutcome, result)
|
||||
} catch (t: Throwable) {
|
||||
if (t.throwableKind == NON_EXCEPTION)
|
||||
throw t // Something totally unexpected. Rethrow.
|
||||
else
|
||||
TestFailedWithException(t)
|
||||
TestFailedWithException(t)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (testFailureDetails != null) TestFailure(serialNumber, testFailureDetails) else null
|
||||
if (testFailureDetails != null) TestFailure(serialNumber, test.sourceLocation, testFailureDetails) else null
|
||||
}
|
||||
|
||||
return if (testFailures.isEmpty()) OK_STATUS else testFailures.joinToString(prefix = "\n", separator = "\n", postfix = "\n")
|
||||
}
|
||||
}
|
||||
|
||||
private sealed interface AbstractErrorMessagePattern : ErrorMessagePattern {
|
||||
fun checkIrLinkageErrorMessage(errorMessage: String?): TestFailureDetails?
|
||||
private sealed interface AbstractFailurePattern : FailurePattern {
|
||||
fun validateFailure(t: Throwable): TestFailureDetails?
|
||||
}
|
||||
|
||||
private class PrefixOfErrorMessage(prefix: String) : AbstractErrorMessagePattern {
|
||||
private sealed class AbstractIrLinkageErrorPattern : AbstractFailurePattern {
|
||||
final override fun validateFailure(t: Throwable) =
|
||||
if (t.isLinkageError)
|
||||
checkIrLinkageErrorMessage(t.message) // OK, this is IR linkage error. Validate the message.
|
||||
else
|
||||
TestFailedWithException(t) // Unexpected type of exception.
|
||||
|
||||
abstract fun checkIrLinkageErrorMessage(errorMessage: String?): TestFailureDetails?
|
||||
}
|
||||
|
||||
private class GeneralIrLinkageError(private val expectedMessageWithoutHashes: String) : AbstractIrLinkageErrorPattern() {
|
||||
init {
|
||||
check(prefix.isNotBlank()) { "Prefix is blank: [$prefix]" }
|
||||
check(expectedMessageWithoutHashes.isNotBlank()) { "Message is blank: [$expectedMessageWithoutHashes]" }
|
||||
}
|
||||
|
||||
private val fullPrefix = "$prefix because it uses unlinked symbols"
|
||||
|
||||
override fun checkIrLinkageErrorMessage(errorMessage: String?) =
|
||||
if (errorMessage?.startsWith(fullPrefix) == true)
|
||||
if (errorMessage?.replace(SIGNATURE_WITH_HASH) { it.groupValues[1] + "'" } == expectedMessageWithoutHashes)
|
||||
null // Success.
|
||||
else
|
||||
TestMismatchedExpectation(fullPrefix, errorMessage)
|
||||
TestMismatchedExpectation(expectedMessageWithoutHashes, errorMessage)
|
||||
|
||||
companion object {
|
||||
val SIGNATURE_WITH_HASH = Regex("(symbol '/[\\da-zA-Z.<>_\\-]+)(\\|\\S+)'")
|
||||
}
|
||||
}
|
||||
|
||||
private class NonImplementedCallable(callableTypeAndName: String, classifierTypeAndName: String) : AbstractErrorMessagePattern {
|
||||
private class NonImplementedCallableIrLinkageError(
|
||||
callableTypeAndName: String,
|
||||
classifierTypeAndName: String
|
||||
) : AbstractIrLinkageErrorPattern() {
|
||||
init {
|
||||
check(callableTypeAndName.isNotBlank() && ' ' in callableTypeAndName) { "Invalid callable type & name: [$callableTypeAndName]" }
|
||||
check(classifierTypeAndName.isNotBlank() && ' ' in classifierTypeAndName) { "Invalid classifier type & name: [$classifierTypeAndName]" }
|
||||
@@ -124,28 +154,65 @@ private class NonImplementedCallable(callableTypeAndName: String, classifierType
|
||||
TestMismatchedExpectation(fullMessage, errorMessage)
|
||||
}
|
||||
|
||||
private sealed interface Test
|
||||
private class FailingTest(val errorMessagePattern: ErrorMessagePattern, val block: Block<Any?>) : Test
|
||||
private class SuccessfulTest(val expectedOutcome: Any, val block: Block<Any>) : Test
|
||||
private class CustomThrowableFailure(private val checker: (Throwable) -> Boolean) : AbstractFailurePattern {
|
||||
override fun validateFailure(t: Throwable) =
|
||||
if (checker(t))
|
||||
null // Expected failure.
|
||||
else
|
||||
TestFailedWithException(t) // Unexpected type of exception.
|
||||
}
|
||||
|
||||
private class TestFailure(val serialNumber: Int, val details: TestFailureDetails) {
|
||||
override fun toString() = "#$serialNumber: ${details.description}"
|
||||
@Suppress("PrivatePropertyName")
|
||||
private val NoWhenBranchFailure = CustomThrowableFailure { it is NoWhenBranchMatchedException }
|
||||
|
||||
private sealed class Test {
|
||||
val sourceLocation: String? = computeSourceLocation()
|
||||
}
|
||||
|
||||
private class FailingTest(val failurePattern: AbstractFailurePattern, val block: Block<Any?>) : Test()
|
||||
private class SuccessfulTest(val expectedOutcome: Any, val block: Block<Any>) : Test()
|
||||
|
||||
private class TestFailure(val serialNumber: Int, val sourceLocation: String?, val details: TestFailureDetails) {
|
||||
override fun toString() = buildString {
|
||||
append('#').append(serialNumber)
|
||||
if (sourceLocation != null) append(" (").append(sourceLocation).append(")")
|
||||
append(": ").append(details.description)
|
||||
}
|
||||
}
|
||||
|
||||
private sealed class TestFailureDetails(val description: String)
|
||||
private object TestSuccessfulButMustFail : TestFailureDetails("Test is successful but was expected to fail.")
|
||||
private class TestSuccessfulButMustFail(actualOutcome: Any?) : TestFailureDetails("Test was expected to fail, but passed successfully: $actualOutcome")
|
||||
private class TestFailedWithException(t: Throwable) : TestFailureDetails("Test unexpectedly failed with exception: $t")
|
||||
private class TestMismatchedExpectation(expectedOutcome: Any, actualOutcome: Any?) :
|
||||
TestFailureDetails("EXPECTED: $expectedOutcome, ACTUAL: $actualOutcome")
|
||||
|
||||
private enum class ThrowableKind { IR_LINKAGE_ERROR, EXCEPTION, NON_EXCEPTION }
|
||||
private val Throwable.isLinkageError: Boolean
|
||||
get() = this::class.simpleName == "IrLinkageError"
|
||||
|
||||
private val Throwable.throwableKind: ThrowableKind
|
||||
get() = when {
|
||||
this::class.simpleName == "IrLinkageError" -> IR_LINKAGE_ERROR
|
||||
this is Exception -> EXCEPTION
|
||||
else -> NON_EXCEPTION
|
||||
fun computeSourceLocation(): String? {
|
||||
fun extractSourceLocation(stackTraceLine: String): String? {
|
||||
return stackTraceLine.substringAfterLast('(', missingDelimiterValue = "")
|
||||
.substringBefore(')', missingDelimiterValue = "")
|
||||
.takeIf { it.isNotEmpty() }
|
||||
?.split(':', limit = 2)
|
||||
?.takeIf { it.size == 2 && it[0].isNotEmpty() && it[1].isNotEmpty() }
|
||||
?.let { "${it[0].substringAfterLast('/').substringAfterLast('\\')}:${it[1]}" }
|
||||
}
|
||||
|
||||
private fun FailingTest.checkIrLinkageErrorMessage(t: Throwable) =
|
||||
(errorMessagePattern as AbstractErrorMessagePattern).checkIrLinkageErrorMessage(t.message)
|
||||
var beenInTestBuilderImpl = false
|
||||
|
||||
// Capture the stack trace to find out the line number where the test was exactly configured.
|
||||
return Throwable().stackTraceToString()
|
||||
.lineSequence()
|
||||
.dropWhile { stackTraceLine ->
|
||||
val isInTestBuilderImpl = TestBuilderImpl::class.simpleName!! in stackTraceLine
|
||||
if (isInTestBuilderImpl) {
|
||||
beenInTestBuilderImpl = true
|
||||
true
|
||||
} else {
|
||||
!beenInTestBuilderImpl
|
||||
}
|
||||
}
|
||||
.mapNotNull(::extractSourceLocation)
|
||||
.firstOrNull()
|
||||
}
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
enum class E {
|
||||
UNCHANGED1, /*ADDED,*/ UNCHANGED2
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
enum class E {
|
||||
UNCHANGED1, ADDED, UNCHANGED2
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
fun compute(e: E): String = when (e) {
|
||||
E.UNCHANGED1 -> "OK"
|
||||
E.UNCHANGED2 -> "OK"
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
import abitestutils.abiTest
|
||||
|
||||
fun box() = abiTest {
|
||||
expectSuccess { compute(E.UNCHANGED2) }
|
||||
expectFailure(noWhenBranch()) { compute(E.ADDED) }
|
||||
expectSuccess { compute(E.UNCHANGED1) }
|
||||
}
|
||||
+1
-1
@@ -1,2 +1,2 @@
|
||||
STEP 0:
|
||||
STEP 1:
|
||||
dependencies: stdlib, lib1, lib2
|
||||
+2
-5
@@ -1,10 +1,7 @@
|
||||
MODULES: lib1, lib2, main
|
||||
|
||||
STEP 0:
|
||||
libs: lib1, lib2, main
|
||||
|
||||
STEP 1:
|
||||
libs: lib1, lib2
|
||||
|
||||
STEP 2:
|
||||
libs: lib1
|
||||
STEP 1:
|
||||
libs: lib1, main
|
||||
@@ -0,0 +1,45 @@
|
||||
sealed class SC1 {
|
||||
class C1 : SC1()
|
||||
object O1 : SC1()
|
||||
// class Added : SC1()
|
||||
class C2 : SC1()
|
||||
object O2 : SC1()
|
||||
}
|
||||
|
||||
sealed class SC2 {
|
||||
class C1 : SC2()
|
||||
object O1 : SC2()
|
||||
// object Added : SC2()
|
||||
class C2 : SC2()
|
||||
object O2 : SC2()
|
||||
}
|
||||
|
||||
sealed interface SI1 {
|
||||
class C1 : SI1
|
||||
object O1 : SI1
|
||||
interface I1 : SI1
|
||||
// class Added : SI1
|
||||
class C2 : SI1
|
||||
object O2 : SI1
|
||||
interface I2 : SI1
|
||||
}
|
||||
|
||||
sealed interface SI2 {
|
||||
class C1 : SI2
|
||||
object O1 : SI2
|
||||
interface I1 : SI2
|
||||
// object Added : SI2
|
||||
class C2 : SI2
|
||||
object O2 : SI2
|
||||
interface I2 : SI2
|
||||
}
|
||||
|
||||
sealed interface SI3 {
|
||||
class C1 : SI3
|
||||
object O1 : SI3
|
||||
interface I1 : SI3
|
||||
// interface Added : SI3
|
||||
class C2 : SI3
|
||||
object O2 : SI3
|
||||
interface I2 : SI3
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
sealed class SC1 {
|
||||
class C1 : SC1()
|
||||
object O1 : SC1()
|
||||
class Added : SC1()
|
||||
class C2 : SC1()
|
||||
object O2 : SC1()
|
||||
}
|
||||
|
||||
sealed class SC2 {
|
||||
class C1 : SC2()
|
||||
object O1 : SC2()
|
||||
object Added : SC2()
|
||||
class C2 : SC2()
|
||||
object O2 : SC2()
|
||||
}
|
||||
|
||||
sealed interface SI1 {
|
||||
class C1 : SI1
|
||||
object O1 : SI1
|
||||
interface I1 : SI1
|
||||
class Added : SI1
|
||||
class C2 : SI1
|
||||
object O2 : SI1
|
||||
interface I2 : SI1
|
||||
}
|
||||
|
||||
sealed interface SI2 {
|
||||
class C1 : SI2
|
||||
object O1 : SI2
|
||||
interface I1 : SI2
|
||||
object Added : SI2
|
||||
class C2 : SI2
|
||||
object O2 : SI2
|
||||
interface I2 : SI2
|
||||
}
|
||||
|
||||
sealed interface SI3 {
|
||||
class C1 : SI3
|
||||
object O1 : SI3
|
||||
interface I1 : SI3
|
||||
interface Added : SI3
|
||||
class C2 : SI3
|
||||
object O2 : SI3
|
||||
interface I2 : SI3
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
fun compute(sealedClass: SC1): String = when (sealedClass) {
|
||||
is SC1.C1 -> "OK"
|
||||
SC1.O1 -> "OK"
|
||||
is SC1.C2 -> "OK"
|
||||
SC1.O2 -> "OK"
|
||||
}
|
||||
|
||||
fun compute(sealedClass: SC2): String = when (sealedClass) {
|
||||
is SC2.C1 -> "OK"
|
||||
SC2.O1 -> "OK"
|
||||
is SC2.C2 -> "OK"
|
||||
SC2.O2 -> "OK"
|
||||
}
|
||||
|
||||
fun compute(sealedInterface: SI1): String = when (sealedInterface) {
|
||||
is SI1.C1 -> "OK"
|
||||
SI1.O1 -> "OK"
|
||||
is SI1.I1 -> "OK"
|
||||
is SI1.C2 -> "OK"
|
||||
SI1.O2 -> "OK"
|
||||
is SI1.I2 -> "OK"
|
||||
}
|
||||
|
||||
fun compute(sealedInterface: SI2): String = when (sealedInterface) {
|
||||
is SI2.C1 -> "OK"
|
||||
SI2.O1 -> "OK"
|
||||
is SI2.I1 -> "OK"
|
||||
is SI2.C2 -> "OK"
|
||||
SI2.O2 -> "OK"
|
||||
is SI2.I2 -> "OK"
|
||||
}
|
||||
|
||||
fun compute(sealedInterface: SI3): String = when (sealedInterface) {
|
||||
is SI3.C1 -> "OK"
|
||||
SI3.O1 -> "OK"
|
||||
is SI3.I1 -> "OK"
|
||||
is SI3.C2 -> "OK"
|
||||
SI3.O2 -> "OK"
|
||||
is SI3.I2 -> "OK"
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
import abitestutils.abiTest
|
||||
|
||||
fun box() = abiTest {
|
||||
expectSuccess { compute(SC1.C1()) }
|
||||
expectSuccess { compute(SC1.O1) }
|
||||
expectFailure(noWhenBranch()) { compute(SC1.Added()) }
|
||||
expectSuccess { compute(SC1.C2()) }
|
||||
expectSuccess { compute(SC1.O2) }
|
||||
|
||||
expectSuccess { compute(SC2.C1()) }
|
||||
expectSuccess { compute(SC2.O1) }
|
||||
expectFailure(noWhenBranch()) { compute(SC2.Added) }
|
||||
expectSuccess { compute(SC2.C2()) }
|
||||
expectSuccess { compute(SC2.O2) }
|
||||
|
||||
expectSuccess { compute(SI1.C1()) }
|
||||
expectSuccess { compute(SI1.O1) }
|
||||
expectSuccess { compute(object : SI1.I1 {}) }
|
||||
expectFailure(noWhenBranch()) { compute(SI1.Added()) }
|
||||
expectSuccess { compute(SI1.C2()) }
|
||||
expectSuccess { compute(SI1.O2) }
|
||||
expectSuccess { compute(object : SI1.I2 {}) }
|
||||
|
||||
expectSuccess { compute(SI2.C1()) }
|
||||
expectSuccess { compute(SI2.O1) }
|
||||
expectSuccess { compute(object : SI2.I1 {}) }
|
||||
expectFailure(noWhenBranch()) { compute(SI2.Added) }
|
||||
expectSuccess { compute(SI2.C2()) }
|
||||
expectSuccess { compute(SI2.O2) }
|
||||
expectSuccess { compute(object : SI2.I2 {}) }
|
||||
|
||||
expectSuccess { compute(SI3.C1()) }
|
||||
expectSuccess { compute(SI3.O1) }
|
||||
expectSuccess { compute(object : SI3.I1 {}) }
|
||||
expectFailure(noWhenBranch()) { compute(object : SI3.Added {}) }
|
||||
expectSuccess { compute(SI3.C2()) }
|
||||
expectSuccess { compute(SI3.O2) }
|
||||
expectSuccess { compute(object : SI3.I2 {}) }
|
||||
}
|
||||
+1
-1
@@ -1,2 +1,2 @@
|
||||
STEP 0:
|
||||
STEP 1:
|
||||
dependencies: stdlib, lib1, lib2
|
||||
+2
-5
@@ -1,10 +1,7 @@
|
||||
MODULES: lib1, lib2, main
|
||||
|
||||
STEP 0:
|
||||
libs: lib1, lib2, main
|
||||
|
||||
STEP 1:
|
||||
libs: lib1, lib2
|
||||
|
||||
STEP 2:
|
||||
libs: lib1
|
||||
STEP 1:
|
||||
libs: lib1, main
|
||||
@@ -0,0 +1,26 @@
|
||||
public open class PublicTopLevelClass {
|
||||
public class PublicToInternalNestedClass
|
||||
public class PublicToProtectedNestedClass
|
||||
public class PublicToPrivateNestedClass
|
||||
public inner class PublicToInternalInnerClass
|
||||
public inner class PublicToProtectedInnerClass
|
||||
public inner class PublicToPrivateInnerClass
|
||||
}
|
||||
|
||||
public open class PublicToInternalTopLevelClass {
|
||||
public class PublicToInternalNestedClass
|
||||
public class PublicToProtectedNestedClass
|
||||
public class PublicToPrivateNestedClass
|
||||
public inner class PublicToInternalInnerClass
|
||||
public inner class PublicToProtectedInnerClass
|
||||
public inner class PublicToPrivateInnerClass
|
||||
}
|
||||
|
||||
public open class PublicToPrivateTopLevelClass {
|
||||
public class PublicToInternalNestedClass
|
||||
public class PublicToProtectedNestedClass
|
||||
public class PublicToPrivateNestedClass
|
||||
public inner class PublicToInternalInnerClass
|
||||
public inner class PublicToProtectedInnerClass
|
||||
public inner class PublicToPrivateInnerClass
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
public open class PublicTopLevelClass {
|
||||
override fun toString() = "PublicTopLevelClass"
|
||||
|
||||
internal class PublicToInternalNestedClass { override fun toString() = "PublicTopLevelClass.PublicToInternalNestedClass" }
|
||||
protected class PublicToProtectedNestedClass { override fun toString() = "PublicTopLevelClass.PublicToProtectedNestedClass" }
|
||||
private class PublicToPrivateNestedClass { override fun toString() = "PublicTopLevelClass.PublicToPrivateNestedClass" }
|
||||
internal inner class PublicToInternalInnerClass { override fun toString() = "PublicTopLevelClass.PublicToInternalInnerClass" }
|
||||
protected inner class PublicToProtectedInnerClass { override fun toString() = "PublicTopLevelClass.PublicToProtectedInnerClass" }
|
||||
private inner class PublicToPrivateInnerClass { override fun toString() = "PublicTopLevelClass.PublicToPrivateInnerClass" }
|
||||
}
|
||||
|
||||
internal open class PublicToInternalTopLevelClass {
|
||||
override fun toString() = "PublicToInternalTopLevelClass"
|
||||
|
||||
internal class PublicToInternalNestedClass { override fun toString() = "PublicToInternalTopLevelClass.PublicToInternalNestedClass" }
|
||||
protected class PublicToProtectedNestedClass { override fun toString() = "PublicToInternalTopLevelClass.PublicToProtectedNestedClass" }
|
||||
private class PublicToPrivateNestedClass { override fun toString() = "PublicToInternalTopLevelClass.PublicToPrivateNestedClass" }
|
||||
internal inner class PublicToInternalInnerClass { override fun toString() = "PublicToInternalTopLevelClass.PublicToInternalInnerClass" }
|
||||
protected inner class PublicToProtectedInnerClass { override fun toString() = "PublicToInternalTopLevelClass.PublicToProtectedInnerClass" }
|
||||
private inner class PublicToPrivateInnerClass { override fun toString() = "PublicToInternalTopLevelClass.PublicToPrivateInnerClass" }
|
||||
}
|
||||
|
||||
private open class PublicToPrivateTopLevelClass {
|
||||
override fun toString() = "PublicToPrivateTopLevelClass"
|
||||
|
||||
internal class PublicToInternalNestedClass { override fun toString() = "PublicToPrivateTopLevelClass.PublicToInternalNestedClass" }
|
||||
protected class PublicToProtectedNestedClass { override fun toString() = "PublicToPrivateTopLevelClass.PublicToProtectedNestedClass" }
|
||||
private class PublicToPrivateNestedClass { override fun toString() = "PublicToPrivateTopLevelClass.PublicToPrivateNestedClass" }
|
||||
internal inner class PublicToInternalInnerClass { override fun toString() = "PublicToPrivateTopLevelClass.PublicToInternalInnerClass" }
|
||||
protected inner class PublicToProtectedInnerClass { override fun toString() = "PublicToPrivateTopLevelClass.PublicToProtectedInnerClass" }
|
||||
private inner class PublicToPrivateInnerClass { override fun toString() = "PublicToPrivateTopLevelClass.PublicToPrivateInnerClass" }
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
@file:Suppress("FunctionName", "UNUSED_PARAMETER")
|
||||
|
||||
/**
|
||||
* Note:
|
||||
*
|
||||
* `fun *_valueParameter()` accepts nullable type and always returns a string.
|
||||
*
|
||||
* `fun *_returnType()` has non-nullable return type but in fact always throws an instrance of [TestException]. This is to avoid induced
|
||||
* errors caused by instantition of the returned declaration itself.
|
||||
*
|
||||
* `fun *_anyReturnType` has [kotlin.Any] return type and always returns just created instance of the declaration.
|
||||
*/
|
||||
|
||||
data class TestException(val id: String) : Exception()
|
||||
private fun fail(id: String): Nothing = throw TestException(id)
|
||||
|
||||
fun PublicTopLevelClass_valueParameter(value: PublicTopLevelClass?): String = "PublicTopLevelClass"
|
||||
fun PublicTopLevelClass_returnType(): PublicTopLevelClass = fail("PublicTopLevelClass")
|
||||
fun PublicTopLevelClass_anyReturnType(): Any = PublicTopLevelClass()
|
||||
fun PublicTopLevelClass_PublicToInternalNestedClass_valueParameter(value: PublicTopLevelClass.PublicToInternalNestedClass?): String = "PublicTopLevelClass.PublicToInternalNestedClass"
|
||||
fun PublicTopLevelClass_PublicToInternalNestedClass_returnType(): PublicTopLevelClass.PublicToInternalNestedClass = fail("PublicTopLevelClass.PublicToInternalNestedClass")
|
||||
fun PublicTopLevelClass_PublicToInternalNestedClass_anyReturnType(): Any = PublicTopLevelClass.PublicToInternalNestedClass()
|
||||
fun PublicTopLevelClass_PublicToProtectedNestedClass_valueParameter(value: PublicTopLevelClass.PublicToProtectedNestedClass?): String = "PublicTopLevelClass.PublicToProtectedNestedClass"
|
||||
fun PublicTopLevelClass_PublicToProtectedNestedClass_returnType(): PublicTopLevelClass.PublicToProtectedNestedClass = fail("PublicTopLevelClass.PublicToProtectedNestedClass")
|
||||
fun PublicTopLevelClass_PublicToProtectedNestedClass_anyReturnType(): Any = PublicTopLevelClass.PublicToProtectedNestedClass()
|
||||
fun PublicTopLevelClass_PublicToPrivateNestedClass_valueParameter(value: PublicTopLevelClass.PublicToPrivateNestedClass?): String = "PublicTopLevelClass.PublicToPrivateNestedClass"
|
||||
fun PublicTopLevelClass_PublicToPrivateNestedClass_returnType(): PublicTopLevelClass.PublicToPrivateNestedClass = fail("PublicTopLevelClass.PublicToPrivateNestedClass")
|
||||
fun PublicTopLevelClass_PublicToPrivateNestedClass_anyReturnType(): Any = PublicTopLevelClass.PublicToPrivateNestedClass()
|
||||
fun PublicTopLevelClass_PublicToInternalInnerClass_valueParameter(value: PublicTopLevelClass.PublicToInternalInnerClass?): String = "PublicTopLevelClass.PublicToInternalInnerClass"
|
||||
fun PublicTopLevelClass_PublicToInternalInnerClass_returnType(): PublicTopLevelClass.PublicToInternalInnerClass = fail("PublicTopLevelClass.PublicToInternalInnerClass")
|
||||
fun PublicTopLevelClass_PublicToInternalInnerClass_anyReturnType(): Any = PublicTopLevelClass().PublicToInternalInnerClass()
|
||||
fun PublicTopLevelClass_PublicToProtectedInnerClass_valueParameter(value: PublicTopLevelClass.PublicToProtectedInnerClass?): String = "PublicTopLevelClass.PublicToProtectedInnerClass"
|
||||
fun PublicTopLevelClass_PublicToProtectedInnerClass_returnType(): PublicTopLevelClass.PublicToProtectedInnerClass = fail("PublicTopLevelClass.PublicToProtectedInnerClass")
|
||||
fun PublicTopLevelClass_PublicToProtectedInnerClass_anyReturnType(): Any = PublicTopLevelClass().PublicToProtectedInnerClass()
|
||||
fun PublicTopLevelClass_PublicToPrivateInnerClass_valueParameter(value: PublicTopLevelClass.PublicToPrivateInnerClass?): String = "PublicTopLevelClass.PublicToPrivateInnerClass"
|
||||
fun PublicTopLevelClass_PublicToPrivateInnerClass_returnType(): PublicTopLevelClass.PublicToPrivateInnerClass = fail("PublicTopLevelClass.PublicToPrivateInnerClass")
|
||||
fun PublicTopLevelClass_PublicToPrivateInnerClass_anyReturnType(): Any = PublicTopLevelClass().PublicToPrivateInnerClass()
|
||||
|
||||
fun PublicToInternalTopLevelClass_valueParameter(value: PublicToInternalTopLevelClass?): String = "PublicToInternalTopLevelClass"
|
||||
fun PublicToInternalTopLevelClass_returnType(): PublicToInternalTopLevelClass = fail("PublicToInternalTopLevelClass")
|
||||
fun PublicToInternalTopLevelClass_anyReturnType(): Any = PublicToInternalTopLevelClass()
|
||||
fun PublicToInternalTopLevelClass_PublicToInternalNestedClass_valueParameter(value: PublicToInternalTopLevelClass.PublicToInternalNestedClass?): String = "PublicToInternalTopLevelClass.PublicToInternalNestedClass"
|
||||
fun PublicToInternalTopLevelClass_PublicToInternalNestedClass_returnType(): PublicToInternalTopLevelClass.PublicToInternalNestedClass = fail("PublicToInternalTopLevelClass.PublicToInternalNestedClass")
|
||||
fun PublicToInternalTopLevelClass_PublicToInternalNestedClass_anyReturnType(): Any = PublicToInternalTopLevelClass.PublicToInternalNestedClass()
|
||||
fun PublicToInternalTopLevelClass_PublicToProtectedNestedClass_valueParameter(value: PublicToInternalTopLevelClass.PublicToProtectedNestedClass?): String = "PublicToInternalTopLevelClass.PublicToProtectedNestedClass"
|
||||
fun PublicToInternalTopLevelClass_PublicToProtectedNestedClass_returnType(): PublicToInternalTopLevelClass.PublicToProtectedNestedClass = fail("PublicToInternalTopLevelClass.PublicToProtectedNestedClass")
|
||||
fun PublicToInternalTopLevelClass_PublicToProtectedNestedClass_anyReturnType(): Any = PublicToInternalTopLevelClass.PublicToProtectedNestedClass()
|
||||
fun PublicToInternalTopLevelClass_PublicToPrivateNestedClass_valueParameter(value: PublicToInternalTopLevelClass.PublicToPrivateNestedClass?): String = "PublicToInternalTopLevelClass.PublicToPrivateNestedClass"
|
||||
fun PublicToInternalTopLevelClass_PublicToPrivateNestedClass_returnType(): PublicToInternalTopLevelClass.PublicToPrivateNestedClass = fail("PublicToInternalTopLevelClass.PublicToPrivateNestedClass")
|
||||
fun PublicToInternalTopLevelClass_PublicToPrivateNestedClass_anyReturnType(): Any = PublicToInternalTopLevelClass.PublicToPrivateNestedClass()
|
||||
fun PublicToInternalTopLevelClass_PublicToInternalInnerClass_valueParameter(value: PublicToInternalTopLevelClass.PublicToInternalInnerClass?): String = "PublicToInternalTopLevelClass.PublicToInternalInnerClass"
|
||||
fun PublicToInternalTopLevelClass_PublicToInternalInnerClass_returnType(): PublicToInternalTopLevelClass.PublicToInternalInnerClass = fail("PublicToInternalTopLevelClass.PublicToInternalInnerClass")
|
||||
fun PublicToInternalTopLevelClass_PublicToInternalInnerClass_anyReturnType(): Any = PublicToInternalTopLevelClass().PublicToInternalInnerClass()
|
||||
fun PublicToInternalTopLevelClass_PublicToProtectedInnerClass_valueParameter(value: PublicToInternalTopLevelClass.PublicToProtectedInnerClass?): String = "PublicToInternalTopLevelClass.PublicToProtectedInnerClass"
|
||||
fun PublicToInternalTopLevelClass_PublicToProtectedInnerClass_returnType(): PublicToInternalTopLevelClass.PublicToProtectedInnerClass = fail("PublicToInternalTopLevelClass.PublicToProtectedInnerClass")
|
||||
fun PublicToInternalTopLevelClass_PublicToProtectedInnerClass_anyReturnType(): Any = PublicToInternalTopLevelClass().PublicToProtectedInnerClass()
|
||||
fun PublicToInternalTopLevelClass_PublicToPrivateInnerClass_valueParameter(value: PublicToInternalTopLevelClass.PublicToPrivateInnerClass?): String = "PublicToInternalTopLevelClass.PublicToPrivateInnerClass"
|
||||
fun PublicToInternalTopLevelClass_PublicToPrivateInnerClass_returnType(): PublicToInternalTopLevelClass.PublicToPrivateInnerClass = fail("PublicToInternalTopLevelClass.PublicToPrivateInnerClass")
|
||||
fun PublicToInternalTopLevelClass_PublicToPrivateInnerClass_anyReturnType(): Any = PublicToInternalTopLevelClass().PublicToPrivateInnerClass()
|
||||
|
||||
fun PublicToPrivateTopLevelClass_valueParameter(value: PublicToPrivateTopLevelClass?): String = "PublicToPrivateTopLevelClass"
|
||||
fun PublicToPrivateTopLevelClass_returnType(): PublicToPrivateTopLevelClass = fail("PublicToPrivateTopLevelClass")
|
||||
fun PublicToPrivateTopLevelClass_anyReturnType(): Any = PublicToPrivateTopLevelClass()
|
||||
fun PublicToPrivateTopLevelClass_PublicToInternalNestedClass_valueParameter(value: PublicToPrivateTopLevelClass.PublicToInternalNestedClass?): String = "PublicToPrivateTopLevelClass.PublicToInternalNestedClass"
|
||||
fun PublicToPrivateTopLevelClass_PublicToInternalNestedClass_returnType(): PublicToPrivateTopLevelClass.PublicToInternalNestedClass = fail("PublicToPrivateTopLevelClass.PublicToInternalNestedClass")
|
||||
fun PublicToPrivateTopLevelClass_PublicToInternalNestedClass_anyReturnType(): Any = PublicToPrivateTopLevelClass.PublicToInternalNestedClass()
|
||||
fun PublicToPrivateTopLevelClass_PublicToProtectedNestedClass_valueParameter(value: PublicToPrivateTopLevelClass.PublicToProtectedNestedClass?): String = "PublicToPrivateTopLevelClass.PublicToProtectedNestedClass"
|
||||
fun PublicToPrivateTopLevelClass_PublicToProtectedNestedClass_returnType(): PublicToPrivateTopLevelClass.PublicToProtectedNestedClass = fail("PublicToPrivateTopLevelClass.PublicToProtectedNestedClass")
|
||||
fun PublicToPrivateTopLevelClass_PublicToProtectedNestedClass_anyReturnType(): Any = PublicToPrivateTopLevelClass.PublicToProtectedNestedClass()
|
||||
fun PublicToPrivateTopLevelClass_PublicToPrivateNestedClass_valueParameter(value: PublicToPrivateTopLevelClass.PublicToPrivateNestedClass?): String = "PublicToPrivateTopLevelClass.PublicToPrivateNestedClass"
|
||||
fun PublicToPrivateTopLevelClass_PublicToPrivateNestedClass_returnType(): PublicToPrivateTopLevelClass.PublicToPrivateNestedClass = fail("PublicToPrivateTopLevelClass.PublicToPrivateNestedClass")
|
||||
fun PublicToPrivateTopLevelClass_PublicToPrivateNestedClass_anyReturnType(): Any = PublicToPrivateTopLevelClass.PublicToPrivateNestedClass()
|
||||
fun PublicToPrivateTopLevelClass_PublicToInternalInnerClass_valueParameter(value: PublicToPrivateTopLevelClass.PublicToInternalInnerClass?): String = "PublicToPrivateTopLevelClass.PublicToInternalInnerClass"
|
||||
fun PublicToPrivateTopLevelClass_PublicToInternalInnerClass_returnType(): PublicToPrivateTopLevelClass.PublicToInternalInnerClass = fail("PublicToPrivateTopLevelClass.PublicToInternalInnerClass")
|
||||
fun PublicToPrivateTopLevelClass_PublicToInternalInnerClass_anyReturnType(): Any = PublicToPrivateTopLevelClass().PublicToInternalInnerClass()
|
||||
fun PublicToPrivateTopLevelClass_PublicToProtectedInnerClass_valueParameter(value: PublicToPrivateTopLevelClass.PublicToProtectedInnerClass?): String = "PublicToPrivateTopLevelClass.PublicToProtectedInnerClass"
|
||||
fun PublicToPrivateTopLevelClass_PublicToProtectedInnerClass_returnType(): PublicToPrivateTopLevelClass.PublicToProtectedInnerClass = fail("PublicToPrivateTopLevelClass.PublicToProtectedInnerClass")
|
||||
fun PublicToPrivateTopLevelClass_PublicToProtectedInnerClass_anyReturnType(): Any = PublicToPrivateTopLevelClass().PublicToProtectedInnerClass()
|
||||
fun PublicToPrivateTopLevelClass_PublicToPrivateInnerClass_valueParameter(value: PublicToPrivateTopLevelClass.PublicToPrivateInnerClass?): String = "PublicToPrivateTopLevelClass.PublicToPrivateInnerClass"
|
||||
fun PublicToPrivateTopLevelClass_PublicToPrivateInnerClass_returnType(): PublicToPrivateTopLevelClass.PublicToPrivateInnerClass = fail("PublicToPrivateTopLevelClass.PublicToPrivateInnerClass")
|
||||
fun PublicToPrivateTopLevelClass_PublicToPrivateInnerClass_anyReturnType(): Any = PublicToPrivateTopLevelClass().PublicToPrivateInnerClass()
|
||||
|
||||
class PublicTopLevelClassInheritor : PublicTopLevelClass() { override fun toString() = "PublicTopLevelClassInheritor" }
|
||||
class PublicToInternalTopLevelClassInheritor : PublicToInternalTopLevelClass() { override fun toString() = "PublicToInternalTopLevelClassInheritor" }
|
||||
class PublicToPrivateTopLevelClassInheritor : PublicToPrivateTopLevelClass() { override fun toString() = "PublicToPrivateTopLevelClassInheritor" }
|
||||
@@ -0,0 +1,117 @@
|
||||
import abitestutils.abiTest
|
||||
import abitestutils.TestBuilder
|
||||
import abitestutils.TestMode.NATIVE_CACHE_STATIC_EVERYWHERE
|
||||
|
||||
fun box() = abiTest {
|
||||
success("PublicTopLevelClass") { PublicTopLevelClass_valueParameter(null) }
|
||||
successViaException("PublicTopLevelClass") { PublicTopLevelClass_returnType() }
|
||||
success("PublicTopLevelClass") { PublicTopLevelClass_anyReturnType() }
|
||||
success("PublicTopLevelClass.PublicToInternalNestedClass") { PublicTopLevelClass_PublicToInternalNestedClass_valueParameter(null) }
|
||||
successViaException("PublicTopLevelClass.PublicToInternalNestedClass") { PublicTopLevelClass_PublicToInternalNestedClass_returnType() }
|
||||
// TODO: KT-54469, creating instance of PublicTopLevelClass.PublicToInternalNestedClass in another module should fail.
|
||||
success("PublicTopLevelClass.PublicToInternalNestedClass") { PublicTopLevelClass_PublicToInternalNestedClass_anyReturnType() }
|
||||
success("PublicTopLevelClass.PublicToProtectedNestedClass") { PublicTopLevelClass_PublicToProtectedNestedClass_valueParameter(null) }
|
||||
successViaException("PublicTopLevelClass.PublicToProtectedNestedClass") { PublicTopLevelClass_PublicToProtectedNestedClass_returnType() }
|
||||
success("PublicTopLevelClass.PublicToProtectedNestedClass") { PublicTopLevelClass_PublicToProtectedNestedClass_anyReturnType() }
|
||||
success("PublicTopLevelClass.PublicToPrivateNestedClass") { PublicTopLevelClass_PublicToPrivateNestedClass_valueParameter(null) }
|
||||
successViaException("PublicTopLevelClass.PublicToPrivateNestedClass") { PublicTopLevelClass_PublicToPrivateNestedClass_returnType() }
|
||||
inaccessible("PublicToPrivateNestedClass") { PublicTopLevelClass_PublicToPrivateNestedClass_anyReturnType() }
|
||||
success("PublicTopLevelClass.PublicToInternalInnerClass") { PublicTopLevelClass_PublicToInternalInnerClass_valueParameter(null) }
|
||||
successViaException("PublicTopLevelClass.PublicToInternalInnerClass") { PublicTopLevelClass_PublicToInternalInnerClass_returnType() }
|
||||
// TODO: KT-54469, creating instance of PublicTopLevelClass.PublicToInternalInnerClass in another module should fail.
|
||||
success("PublicTopLevelClass.PublicToInternalInnerClass") { PublicTopLevelClass_PublicToInternalInnerClass_anyReturnType() }
|
||||
success("PublicTopLevelClass.PublicToProtectedInnerClass") { PublicTopLevelClass_PublicToProtectedInnerClass_valueParameter(null) }
|
||||
successViaException("PublicTopLevelClass.PublicToProtectedInnerClass") { PublicTopLevelClass_PublicToProtectedInnerClass_returnType() }
|
||||
success("PublicTopLevelClass.PublicToProtectedInnerClass") { PublicTopLevelClass_PublicToProtectedInnerClass_anyReturnType() }
|
||||
success("PublicTopLevelClass.PublicToPrivateInnerClass") { PublicTopLevelClass_PublicToPrivateInnerClass_valueParameter(null) }
|
||||
successViaException("PublicTopLevelClass.PublicToPrivateInnerClass") { PublicTopLevelClass_PublicToPrivateInnerClass_returnType() }
|
||||
inaccessible("PublicToPrivateInnerClass") { PublicTopLevelClass_PublicToPrivateInnerClass_anyReturnType() }
|
||||
|
||||
// TODO: KT-54469, accessing PublicToInternalTopLevelClass and all nested classes should fail.
|
||||
success("PublicToInternalTopLevelClass") { PublicToInternalTopLevelClass_valueParameter(null) }
|
||||
successViaException("PublicToInternalTopLevelClass") { PublicToInternalTopLevelClass_returnType() }
|
||||
success("PublicToInternalTopLevelClass") { PublicToInternalTopLevelClass_anyReturnType() }
|
||||
success("PublicToInternalTopLevelClass.PublicToInternalNestedClass") { PublicToInternalTopLevelClass_PublicToInternalNestedClass_valueParameter(null) }
|
||||
successViaException("PublicToInternalTopLevelClass.PublicToInternalNestedClass") { PublicToInternalTopLevelClass_PublicToInternalNestedClass_returnType() }
|
||||
success("PublicToInternalTopLevelClass.PublicToInternalNestedClass") { PublicToInternalTopLevelClass_PublicToInternalNestedClass_anyReturnType() }
|
||||
success("PublicToInternalTopLevelClass.PublicToProtectedNestedClass") { PublicToInternalTopLevelClass_PublicToProtectedNestedClass_valueParameter(null) }
|
||||
successViaException("PublicToInternalTopLevelClass.PublicToProtectedNestedClass") { PublicToInternalTopLevelClass_PublicToProtectedNestedClass_returnType() }
|
||||
success("PublicToInternalTopLevelClass.PublicToProtectedNestedClass") { PublicToInternalTopLevelClass_PublicToProtectedNestedClass_anyReturnType() }
|
||||
success("PublicToInternalTopLevelClass.PublicToPrivateNestedClass") { PublicToInternalTopLevelClass_PublicToPrivateNestedClass_valueParameter(null) }
|
||||
successViaException("PublicToInternalTopLevelClass.PublicToPrivateNestedClass") { PublicToInternalTopLevelClass_PublicToPrivateNestedClass_returnType() }
|
||||
inaccessible("PublicToPrivateNestedClass") { PublicToInternalTopLevelClass_PublicToPrivateNestedClass_anyReturnType() }
|
||||
success("PublicToInternalTopLevelClass.PublicToInternalInnerClass") { PublicToInternalTopLevelClass_PublicToInternalInnerClass_valueParameter(null) }
|
||||
successViaException("PublicToInternalTopLevelClass.PublicToInternalInnerClass") { PublicToInternalTopLevelClass_PublicToInternalInnerClass_returnType() }
|
||||
success("PublicToInternalTopLevelClass.PublicToInternalInnerClass") { PublicToInternalTopLevelClass_PublicToInternalInnerClass_anyReturnType() }
|
||||
success("PublicToInternalTopLevelClass.PublicToProtectedInnerClass") { PublicToInternalTopLevelClass_PublicToProtectedInnerClass_valueParameter(null) }
|
||||
successViaException("PublicToInternalTopLevelClass.PublicToProtectedInnerClass") { PublicToInternalTopLevelClass_PublicToProtectedInnerClass_returnType() }
|
||||
success("PublicToInternalTopLevelClass.PublicToProtectedInnerClass") { PublicToInternalTopLevelClass_PublicToProtectedInnerClass_anyReturnType() }
|
||||
success("PublicToInternalTopLevelClass.PublicToPrivateInnerClass") { PublicToInternalTopLevelClass_PublicToPrivateInnerClass_valueParameter(null) }
|
||||
successViaException("PublicToInternalTopLevelClass.PublicToPrivateInnerClass") { PublicToInternalTopLevelClass_PublicToPrivateInnerClass_returnType() }
|
||||
inaccessible("PublicToPrivateInnerClass") { PublicToInternalTopLevelClass_PublicToPrivateInnerClass_anyReturnType() }
|
||||
|
||||
unlinkedSymbolInValueParameter("/PublicToPrivateTopLevelClass") { PublicToPrivateTopLevelClass_valueParameter(null) }
|
||||
unlinkedSymbolInReturnType("/PublicToPrivateTopLevelClass") { PublicToPrivateTopLevelClass_returnType() }
|
||||
unlinkedConstructorSymbol("/PublicToPrivateTopLevelClass.<init>") { PublicToPrivateTopLevelClass_anyReturnType() }
|
||||
unlinkedSymbolInValueParameter("/PublicToPrivateTopLevelClass.PublicToInternalNestedClass") { PublicToPrivateTopLevelClass_PublicToInternalNestedClass_valueParameter(null) }
|
||||
unlinkedSymbolInReturnType("/PublicToPrivateTopLevelClass.PublicToInternalNestedClass") { PublicToPrivateTopLevelClass_PublicToInternalNestedClass_returnType() }
|
||||
unlinkedConstructorSymbol("/PublicToPrivateTopLevelClass.PublicToInternalNestedClass.<init>") { PublicToPrivateTopLevelClass_PublicToInternalNestedClass_anyReturnType() }
|
||||
unlinkedSymbolInValueParameter("/PublicToPrivateTopLevelClass.PublicToProtectedNestedClass") { PublicToPrivateTopLevelClass_PublicToProtectedNestedClass_valueParameter(null) }
|
||||
unlinkedSymbolInReturnType("/PublicToPrivateTopLevelClass.PublicToProtectedNestedClass") { PublicToPrivateTopLevelClass_PublicToProtectedNestedClass_returnType() }
|
||||
unlinkedConstructorSymbol("/PublicToPrivateTopLevelClass.PublicToProtectedNestedClass.<init>") { PublicToPrivateTopLevelClass_PublicToProtectedNestedClass_anyReturnType() }
|
||||
unlinkedSymbolInValueParameter("/PublicToPrivateTopLevelClass.PublicToPrivateNestedClass") { PublicToPrivateTopLevelClass_PublicToPrivateNestedClass_valueParameter(null) }
|
||||
unlinkedSymbolInReturnType("/PublicToPrivateTopLevelClass.PublicToPrivateNestedClass") { PublicToPrivateTopLevelClass_PublicToPrivateNestedClass_returnType() }
|
||||
unlinkedConstructorSymbol("/PublicToPrivateTopLevelClass.PublicToPrivateNestedClass.<init>") { PublicToPrivateTopLevelClass_PublicToPrivateNestedClass_anyReturnType() }
|
||||
unlinkedSymbolInValueParameter("/PublicToPrivateTopLevelClass.PublicToInternalInnerClass") { PublicToPrivateTopLevelClass_PublicToInternalInnerClass_valueParameter(null) }
|
||||
unlinkedSymbolInReturnType("/PublicToPrivateTopLevelClass.PublicToInternalInnerClass") { PublicToPrivateTopLevelClass_PublicToInternalInnerClass_returnType() }
|
||||
unlinkedConstructorSymbol("/PublicToPrivateTopLevelClass.<init>") { PublicToPrivateTopLevelClass_PublicToInternalInnerClass_anyReturnType() }
|
||||
unlinkedSymbolInValueParameter("/PublicToPrivateTopLevelClass.PublicToProtectedInnerClass") { PublicToPrivateTopLevelClass_PublicToProtectedInnerClass_valueParameter(null) }
|
||||
unlinkedSymbolInReturnType("/PublicToPrivateTopLevelClass.PublicToProtectedInnerClass") { PublicToPrivateTopLevelClass_PublicToProtectedInnerClass_returnType() }
|
||||
unlinkedConstructorSymbol("/PublicToPrivateTopLevelClass.<init>") { PublicToPrivateTopLevelClass_PublicToProtectedInnerClass_anyReturnType() }
|
||||
unlinkedSymbolInValueParameter("/PublicToPrivateTopLevelClass.PublicToPrivateInnerClass") { PublicToPrivateTopLevelClass_PublicToPrivateInnerClass_valueParameter(null) }
|
||||
unlinkedSymbolInReturnType("/PublicToPrivateTopLevelClass.PublicToPrivateInnerClass") { PublicToPrivateTopLevelClass_PublicToPrivateInnerClass_returnType() }
|
||||
unlinkedConstructorSymbol("/PublicToPrivateTopLevelClass.<init>") { PublicToPrivateTopLevelClass_PublicToPrivateInnerClass_anyReturnType() }
|
||||
|
||||
success("PublicTopLevelClassInheritor") { PublicTopLevelClassInheritor() }
|
||||
// TODO: KT-54469, creating instance of PublicToInternalTopLevelClassInheritor should fail.
|
||||
success("PublicToInternalTopLevelClassInheritor") { PublicToInternalTopLevelClassInheritor() }
|
||||
expectFailure(linkage("Constructor 'PublicToPrivateTopLevelClassInheritor.<init>' can not be called: Class 'PublicToPrivateTopLevelClassInheritor' uses unlinked class symbol '/PublicToPrivateTopLevelClass'")) { PublicToPrivateTopLevelClassInheritor() }
|
||||
}
|
||||
|
||||
// Shortcuts:
|
||||
private inline fun TestBuilder.success(expectedOutcome: String, noinline block: () -> Any) =
|
||||
expectSuccess(expectedOutcome) { block().toString() }
|
||||
|
||||
private inline fun TestBuilder.successViaException(testExceptionId: String, noinline block: () -> Unit) =
|
||||
expectFailure(custom { (it as? TestException)?.id == testExceptionId }, block)
|
||||
|
||||
private inline fun TestBuilder.inaccessible(className: String, noinline block: () -> Unit) = expectFailure(
|
||||
linkage("Constructor '$className.<init>' can not be called: Private constructor declared in module <lib1> can not be accessed in module <lib2>"),
|
||||
block
|
||||
)
|
||||
|
||||
private inline fun TestBuilder.unlinkedSymbolInValueParameter(signature: String, noinline block: () -> Unit) {
|
||||
val functionName = signature.removePrefix("/").replace('.', '_') + "_valueParameter"
|
||||
unlinkedSymbol(signature, functionName, block)
|
||||
}
|
||||
|
||||
private inline fun TestBuilder.unlinkedSymbolInReturnType(signature: String, noinline block: () -> Unit) {
|
||||
val functionName = signature.removePrefix("/").replace('.', '_') + "_returnType"
|
||||
unlinkedSymbol(signature, functionName, block)
|
||||
}
|
||||
|
||||
private inline fun TestBuilder.unlinkedConstructorSymbol(signature: String, noinline block: () -> Unit) {
|
||||
val constructorName = signature.removePrefix("/").split('.').takeLast(2).joinToString(".")
|
||||
expectFailure(linkage("Constructor '$constructorName' can not be called: No constructor found for symbol '$signature'"), block)
|
||||
}
|
||||
|
||||
private inline fun TestBuilder.unlinkedSymbol(signature: String, functionName: String, noinline block: () -> Unit) {
|
||||
// Need to slightly adjust the expected IR linkage error message. Reason: When Lazy IR is used the type of the
|
||||
// symbol is determined more accurately.
|
||||
val symbolKind = if ("InnerClass" in functionName && testMode == NATIVE_CACHE_STATIC_EVERYWHERE)
|
||||
"inner class"
|
||||
else
|
||||
"class"
|
||||
|
||||
expectFailure(linkage("Function '$functionName' can not be called: Function uses unlinked $symbolKind symbol '$signature'"), block)
|
||||
}
|
||||
@@ -1,21 +1,26 @@
|
||||
public fun publicToInternalTopLevelFunction() = "publicToInternalTopLevelFunction.v1"
|
||||
public fun publicToInternalPATopLevelFunction() = "publicToInternalPATopLevelFunction.v1"
|
||||
public fun publicToPrivateTopLevelFunction() = "publicToPrivateTopLevelFunction.v1"
|
||||
|
||||
open class Container {
|
||||
public fun publicToProtectedFunction() = "Container.publicToProtectedFunction.v1"
|
||||
public fun publicToInternalFunction() = "Container.publicToInternalFunction.v1"
|
||||
public fun publicToInternalPAFunction() = "Container.publicToInternalPAFunction.v1"
|
||||
public fun publicToPrivateFunction() = "Container.publicToPrivateFunction.v1"
|
||||
|
||||
protected fun protectedToPublicFunction() = "Container.protectedToPublicFunction.v1"
|
||||
protected fun protectedToInternalFunction() = "Container.protectedToInternalFunction.v1"
|
||||
protected fun protectedToInternalPAFunction() = "Container.protectedToInternalPAFunction.v1"
|
||||
protected fun protectedToPrivateFunction() = "Container.protectedToPrivateFunction.v1"
|
||||
|
||||
public open fun publicToProtectedOverriddenFunction() = "Container.publicToProtectedOverriddenFunction.v1"
|
||||
public open fun publicToInternalOverriddenFunction() = "Container.publicToInternalOverriddenFunction.v1"
|
||||
public open fun publicToInternalPAOverriddenFunction() = "Container.publicToInternalPAOverriddenFunction.v1"
|
||||
public open fun publicToPrivateOverriddenFunction() = "Container.publicToPrivateOverriddenFunction.v1"
|
||||
|
||||
protected open fun protectedToPublicOverriddenFunction() = "Container.protectedToPublicOverriddenFunction.v1"
|
||||
protected open fun protectedToInternalOverriddenFunction() = "Container.protectedToInternalOverriddenFunction.v1"
|
||||
protected open fun protectedToInternalPAOverriddenFunction() = "Container.protectedToInternalPAOverriddenFunction.v1"
|
||||
protected open fun protectedToPrivateOverriddenFunction() = "Container.protectedToPrivateOverriddenFunction.v1"
|
||||
|
||||
// public fun newPublicFunction() = "Container.newPublicFunction.v1"
|
||||
@@ -24,5 +29,7 @@ open class Container {
|
||||
// protected open fun newOpenProtectedFunction() = "Container.newOpenProtectedFunction.v1"
|
||||
// internal fun newInternalFunction() = "Container.newInternalFunction.v1"
|
||||
// internal open fun newOpenInternalFunction() = "Container.newOpenInternalFunction.v1"
|
||||
// @PublishedApi internal fun newInternalPAFunction() = "Container.newInternalPAFunction.v1"
|
||||
// @PublishedApi internal open fun newOpenInternalPAFunction() = "Container.newOpenInternalPAFunction.v1"
|
||||
// private fun newPrivateFunction() = "Container.newPrivateFunction.v1"
|
||||
}
|
||||
|
||||
@@ -1,21 +1,26 @@
|
||||
internal fun publicToInternalTopLevelFunction() = "publicToInternalTopLevelFunction.v2"
|
||||
@PublishedApi internal fun publicToInternalPATopLevelFunction() = "publicToInternalPATopLevelFunction.v2"
|
||||
private fun publicToPrivateTopLevelFunction() = "publicToPrivateTopLevelFunction.v2"
|
||||
|
||||
open class Container {
|
||||
protected fun publicToProtectedFunction() = "Container.publicToProtectedFunction.v2"
|
||||
internal fun publicToInternalFunction() = "Container.publicToInternalFunction.v2"
|
||||
@PublishedApi internal fun publicToInternalPAFunction() = "Container.publicToInternalPAFunction.v2"
|
||||
private fun publicToPrivateFunction() = "Container.publicToPrivateFunction.v2"
|
||||
|
||||
public fun protectedToPublicFunction() = "Container.protectedToPublicFunction.v2"
|
||||
internal fun protectedToInternalFunction() = "Container.protectedToInternalFunction.v2"
|
||||
@PublishedApi internal fun protectedToInternalPAFunction() = "Container.protectedToInternalPAFunction.v2"
|
||||
private fun protectedToPrivateFunction() = "Container.protectedToPrivateFunction.v2"
|
||||
|
||||
protected open fun publicToProtectedOverriddenFunction() = "Container.publicToProtectedOverriddenFunction.v2"
|
||||
internal open fun publicToInternalOverriddenFunction() = "Container.publicToInternalOverriddenFunction.v2"
|
||||
@PublishedApi internal open fun publicToInternalPAOverriddenFunction() = "Container.publicToInternalPAOverriddenFunction.v2"
|
||||
private /*open*/ fun publicToPrivateOverriddenFunction() = "Container.publicToPrivateOverriddenFunction.v2"
|
||||
|
||||
public open fun protectedToPublicOverriddenFunction() = "Container.protectedToPublicOverriddenFunction.v2"
|
||||
internal open fun protectedToInternalOverriddenFunction() = "Container.protectedToInternalOverriddenFunction.v2"
|
||||
@PublishedApi internal open fun protectedToInternalPAOverriddenFunction() = "Container.protectedToInternalPAOverriddenFunction.v2"
|
||||
private /*open*/ fun protectedToPrivateOverriddenFunction() = "Container.protectedToPrivateOverriddenFunction.v2"
|
||||
|
||||
public fun newPublicFunction() = "Container.newPublicFunction.v2"
|
||||
@@ -24,5 +29,7 @@ open class Container {
|
||||
protected open fun newOpenProtectedFunction() = "Container.newOpenProtectedFunction.v2"
|
||||
internal fun newInternalFunction() = "Container.newInternalFunction.v2"
|
||||
internal open fun newOpenInternalFunction() = "Container.newOpenInternalFunction.v2"
|
||||
@PublishedApi internal fun newInternalPAFunction() = "Container.newInternalPAFunction.v2"
|
||||
@PublishedApi internal open fun newOpenInternalPAFunction() = "Container.newOpenInternalPAFunction.v2"
|
||||
private fun newPrivateFunction() = "Container.newPrivateFunction.v2"
|
||||
}
|
||||
|
||||
@@ -2,25 +2,30 @@ class ContainerImpl : Container() {
|
||||
// Just to check that accessing from within the class hierarchy has the same effect as accessing from the outside:
|
||||
fun publicToProtectedFunctionAccess() = publicToProtectedFunction()
|
||||
fun publicToInternalFunctionAccess() = publicToInternalFunction()
|
||||
fun publicToInternalPAFunctionAccess() = publicToInternalPAFunction()
|
||||
fun publicToPrivateFunctionAccess() = publicToPrivateFunction()
|
||||
|
||||
// As far as protected members can't be accessed outside of the class hierarchy, we need special accessors.
|
||||
fun protectedToPublicFunctionAccess() = protectedToPublicFunction()
|
||||
fun protectedToInternalFunctionAccess() = protectedToInternalFunction()
|
||||
fun protectedToInternalPAFunctionAccess() = protectedToInternalPAFunction()
|
||||
fun protectedToPrivateFunctionAccess() = protectedToPrivateFunction()
|
||||
|
||||
// Overridden functions with changed visibility:
|
||||
override fun publicToProtectedOverriddenFunction() = "ContainerImpl.publicToProtectedOverriddenFunction"
|
||||
override fun publicToInternalOverriddenFunction() = "ContainerImpl.publicToInternalOverriddenFunction"
|
||||
override fun publicToInternalPAOverriddenFunction() = "ContainerImpl.publicToInternalPAOverriddenFunction"
|
||||
override fun publicToPrivateOverriddenFunction() = "ContainerImpl.publicToPrivateOverriddenFunction"
|
||||
|
||||
override fun protectedToPublicOverriddenFunction() = "ContainerImpl.protectedToPublicOverriddenFunction"
|
||||
override fun protectedToInternalOverriddenFunction() = "ContainerImpl.protectedToInternalOverriddenFunction"
|
||||
override fun protectedToInternalPAOverriddenFunction() = "ContainerImpl.protectedToInternalPAOverriddenFunction"
|
||||
override fun protectedToPrivateOverriddenFunction() = "ContainerImpl.protectedToPrivateOverriddenFunction"
|
||||
|
||||
// As far as protected members can't be accessed outside of the class hierarchy, we need special accessors.
|
||||
fun protectedToPublicOverriddenFunctionAccess() = protectedToPublicOverriddenFunction()
|
||||
fun protectedToInternalOverriddenFunctionAccess() = protectedToInternalOverriddenFunction()
|
||||
fun protectedToInternalPAOverriddenFunctionAccess() = protectedToInternalPAOverriddenFunction()
|
||||
fun protectedToPrivateOverriddenFunctionAccess() = protectedToPrivateOverriddenFunction()
|
||||
|
||||
// Functions that accedentally start to override/conflict with functions added to Container since version v2:
|
||||
@@ -30,6 +35,8 @@ class ContainerImpl : Container() {
|
||||
protected fun newOpenProtectedFunction() = "ContainerImpl.newOpenProtectedFunction"
|
||||
internal fun newInternalFunction() = "ContainerImpl.newInternalFunction"
|
||||
internal fun newOpenInternalFunction() = "ContainerImpl.newOpenInternalFunction"
|
||||
@PublishedApi internal fun newInternalPAFunction() = "ContainerImpl.newInternalPAFunction"
|
||||
@PublishedApi internal fun newOpenInternalPAFunction() = "ContainerImpl.newOpenInternalPAFunction"
|
||||
private fun newPrivateFunction() = "ContainerImpl.newPrivateFunction"
|
||||
|
||||
// As far as protected/private members can't be accessed outside of the class hierarchy, and internal can't be accessed
|
||||
@@ -38,5 +45,7 @@ class ContainerImpl : Container() {
|
||||
fun newOpenProtectedFunctionAccess() = newOpenProtectedFunction()
|
||||
fun newInternalFunctionAccess() = newInternalFunction()
|
||||
fun newOpenInternalFunctionAccess() = newOpenInternalFunction()
|
||||
fun newInternalPAFunctionAccess() = newInternalPAFunction()
|
||||
fun newOpenInternalPAFunctionAccess() = newOpenInternalPAFunction()
|
||||
fun newPrivateFunctionAccess() = newPrivateFunction()
|
||||
}
|
||||
|
||||
+59
-27
@@ -1,33 +1,65 @@
|
||||
import abitestutils.abiTest
|
||||
import abitestutils.TestBuilder
|
||||
import abitestutils.TestMode.NATIVE_CACHE_STATIC_EVERYWHERE
|
||||
|
||||
fun box() = abiTest {
|
||||
val c = Container()
|
||||
val ci = ContainerImpl()
|
||||
expectSuccess("publicToInternalTopLevelFunction.v2") { publicToInternalTopLevelFunction() }
|
||||
expectFailure(prefixed("function publicToPrivateTopLevelFunction can not be called")) { publicToPrivateTopLevelFunction() }
|
||||
expectSuccess("Container.publicToProtectedFunction.v2") { c.publicToProtectedFunction() }
|
||||
expectSuccess("Container.publicToProtectedFunction.v2") { ci.publicToProtectedFunction() }
|
||||
expectFailure(prefixed("function publicToInternalFunction can not be called")) { c.publicToInternalFunction() }
|
||||
expectFailure(prefixed("function publicToInternalFunction can not be called")) { ci.publicToInternalFunction() }
|
||||
expectFailure(prefixed("function publicToPrivateFunction can not be called")) { c.publicToPrivateFunction() }
|
||||
expectFailure(prefixed("function publicToPrivateFunction can not be called")) { ci.publicToPrivateFunction() }
|
||||
expectSuccess("Container.publicToProtectedFunction.v2") { ci.publicToProtectedFunctionAccess() }
|
||||
expectFailure(prefixed("function publicToInternalFunction can not be called")) { ci.publicToInternalFunctionAccess() }
|
||||
expectFailure(prefixed("function publicToPrivateFunction can not be called")) { ci.publicToPrivateFunctionAccess() }
|
||||
expectSuccess("Container.protectedToPublicFunction.v2") { ci.protectedToPublicFunctionAccess() }
|
||||
expectFailure(prefixed("function protectedToInternalFunction can not be called")) { ci.protectedToInternalFunctionAccess() }
|
||||
expectFailure(prefixed("function protectedToPrivateFunction can not be called")) { ci.protectedToPrivateFunctionAccess() }
|
||||
expectSuccess("ContainerImpl.publicToProtectedOverriddenFunction") { ci.publicToProtectedOverriddenFunction() }
|
||||
expectSuccess("ContainerImpl.publicToInternalOverriddenFunction") { ci.publicToInternalOverriddenFunction() }
|
||||
expectSuccess("ContainerImpl.publicToPrivateOverriddenFunction") { ci.publicToPrivateOverriddenFunction() }
|
||||
expectSuccess("ContainerImpl.protectedToPublicOverriddenFunction") { ci.protectedToPublicOverriddenFunctionAccess() }
|
||||
expectSuccess("ContainerImpl.protectedToInternalOverriddenFunction") { ci.protectedToInternalOverriddenFunctionAccess() }
|
||||
expectSuccess("ContainerImpl.protectedToPrivateOverriddenFunction") { ci.protectedToPrivateOverriddenFunctionAccess() }
|
||||
expectSuccess("ContainerImpl.newPublicFunction") { ci.newPublicFunction() }
|
||||
expectSuccess("ContainerImpl.newOpenPublicFunction") { ci.newOpenPublicFunction() }
|
||||
expectSuccess("ContainerImpl.newProtectedFunction") { ci.newProtectedFunctionAccess() }
|
||||
expectSuccess("ContainerImpl.newOpenProtectedFunction") { ci.newOpenProtectedFunctionAccess() }
|
||||
expectSuccess("ContainerImpl.newInternalFunction") { ci.newInternalFunctionAccess() }
|
||||
expectSuccess("ContainerImpl.newOpenInternalFunction") { ci.newOpenInternalFunctionAccess() }
|
||||
expectSuccess("ContainerImpl.newPrivateFunction") { ci.newPrivateFunctionAccess() }
|
||||
|
||||
success("publicToInternalTopLevelFunction.v2") { publicToInternalTopLevelFunction() } // Signature remains the same.
|
||||
success("publicToInternalPATopLevelFunction.v2") { publicToInternalPATopLevelFunction() } // Signature remains the same.
|
||||
unlinkedSymbol("/publicToPrivateTopLevelFunction") { publicToPrivateTopLevelFunction() } // Signature changed.
|
||||
|
||||
success("Container.publicToProtectedFunction.v2") { c.publicToProtectedFunction() } // Signature remains the same.
|
||||
success("Container.publicToProtectedFunction.v2") { ci.publicToProtectedFunction() } // Signature remains the same.
|
||||
// TODO: KT-54469, Container.publicToInternalFunction() should fail because it is accessed from another module.
|
||||
success("Container.publicToInternalFunction.v2") { c.publicToInternalFunction() } // Signature remains the same.
|
||||
unlinkedSymbol("/ContainerImpl.publicToInternalFunction") { ci.publicToInternalFunction() } // FOs are not generated for internal members from other module.
|
||||
// TODO: KT-54469, Container.publicToInternalPAFunction() should fail because it is accessed from another module.
|
||||
success("Container.publicToInternalPAFunction.v2") { c.publicToInternalPAFunction() } // Signature remains the same.
|
||||
unlinkedSymbol("/ContainerImpl.publicToInternalPAFunction") { ci.publicToInternalPAFunction() } // FOs are not generated for internal members from other module.
|
||||
inaccessible("publicToPrivateFunction") { c.publicToPrivateFunction() } // Inaccessible from other module though signature remains the same.
|
||||
unlinkedSymbol("/ContainerImpl.publicToPrivateFunction") { ci.publicToPrivateFunction() } // FOs are not generated for private members.
|
||||
|
||||
success("Container.publicToProtectedFunction.v2") { ci.publicToProtectedFunctionAccess() } // Signature remains the same.
|
||||
unlinkedSymbol("/ContainerImpl.publicToInternalFunction") { ci.publicToInternalFunctionAccess() } // FOs are not generated for internal members from other module.
|
||||
unlinkedSymbol("/ContainerImpl.publicToInternalPAFunction") { ci.publicToInternalPAFunctionAccess() } // FOs are not generated for internal members from other module.
|
||||
unlinkedSymbol("/ContainerImpl.publicToPrivateFunction") { ci.publicToPrivateFunctionAccess() } // FOs are not generated for private members.
|
||||
success("Container.protectedToPublicFunction.v2") { ci.protectedToPublicFunctionAccess() } // Signature remains the same.
|
||||
unlinkedSymbol("/ContainerImpl.protectedToInternalFunction") { ci.protectedToInternalFunctionAccess() } // FOs are not generated for internal members from other module.
|
||||
unlinkedSymbol("/ContainerImpl.protectedToInternalPAFunction") { ci.protectedToInternalPAFunctionAccess() } // FOs are not generated for internal members from other module.
|
||||
unlinkedSymbol("/ContainerImpl.protectedToPrivateFunction") { ci.protectedToPrivateFunctionAccess() } // FOs are not generated for private members.
|
||||
|
||||
success("ContainerImpl.publicToProtectedOverriddenFunction") { ci.publicToProtectedOverriddenFunction() }
|
||||
success("ContainerImpl.publicToInternalOverriddenFunction") { ci.publicToInternalOverriddenFunction() }
|
||||
success("ContainerImpl.publicToInternalPAOverriddenFunction") { ci.publicToInternalPAOverriddenFunction() }
|
||||
success("ContainerImpl.publicToPrivateOverriddenFunction") { ci.publicToPrivateOverriddenFunction() }
|
||||
success("ContainerImpl.protectedToPublicOverriddenFunction") { ci.protectedToPublicOverriddenFunctionAccess() }
|
||||
success("ContainerImpl.protectedToInternalOverriddenFunction") { ci.protectedToInternalOverriddenFunctionAccess() }
|
||||
success("ContainerImpl.protectedToInternalPAOverriddenFunction") { ci.protectedToInternalPAOverriddenFunctionAccess() }
|
||||
success("ContainerImpl.protectedToPrivateOverriddenFunction") { ci.protectedToPrivateOverriddenFunctionAccess() }
|
||||
|
||||
success("ContainerImpl.newPublicFunction") { ci.newPublicFunction() }
|
||||
success("ContainerImpl.newOpenPublicFunction") { ci.newOpenPublicFunction() }
|
||||
success("ContainerImpl.newProtectedFunction") { ci.newProtectedFunctionAccess() }
|
||||
success("ContainerImpl.newOpenProtectedFunction") { ci.newOpenProtectedFunctionAccess() }
|
||||
success("ContainerImpl.newInternalFunction") { ci.newInternalFunctionAccess() }
|
||||
success("ContainerImpl.newOpenInternalFunction") { ci.newOpenInternalFunctionAccess() }
|
||||
success("ContainerImpl.newInternalPAFunction") { ci.newInternalPAFunctionAccess() }
|
||||
success("ContainerImpl.newOpenInternalPAFunction") { ci.newOpenInternalPAFunctionAccess() }
|
||||
success("ContainerImpl.newPrivateFunction") { ci.newPrivateFunctionAccess() }
|
||||
}
|
||||
|
||||
// Shortcuts:
|
||||
private inline fun TestBuilder.success(expectedOutcome: String, noinline block: () -> String) =
|
||||
expectSuccess(expectedOutcome, block)
|
||||
|
||||
private inline fun TestBuilder.unlinkedSymbol(signature: String, noinline block: () -> Unit) {
|
||||
val functionName = signature.removePrefix("/").substringAfterLast(".")
|
||||
expectFailure(linkage("Function '$functionName' can not be called: No function found for symbol '$signature'"), block)
|
||||
}
|
||||
|
||||
private inline fun TestBuilder.inaccessible(functionName: String, noinline block: () -> Unit) = expectFailure(
|
||||
linkage("Function '$functionName' can not be called: Private function declared in module <lib1> can not be accessed in module <main>"),
|
||||
block
|
||||
)
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
MUTED
|
||||
MODULES: lib1, lib2, main
|
||||
|
||||
STEP 0:
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
public val publicToInternalTopLevelProperty1 = "publicToInternalTopLevelProperty1.v1"
|
||||
public val publicToInternalTopLevelProperty2 get() = "publicToInternalTopLevelProperty2.v1"
|
||||
public val publicToInternalPATopLevelProperty1 = "publicToInternalPATopLevelProperty1.v1"
|
||||
public val publicToInternalPATopLevelProperty2 get() = "publicToInternalPATopLevelProperty2.v1"
|
||||
public val publicToPrivateTopLevelProperty1 = "publicToPrivateTopLevelProperty1.v1"
|
||||
public val publicToPrivateTopLevelProperty2 get() = "publicToPrivateTopLevelProperty2.v1"
|
||||
|
||||
@@ -8,6 +10,8 @@ open class Container {
|
||||
public val publicToProtectedProperty2 get() = "Container.publicToProtectedProperty2.v1"
|
||||
public val publicToInternalProperty1 = "Container.publicToInternalProperty1.v1"
|
||||
public val publicToInternalProperty2 get() = "Container.publicToInternalProperty2.v1"
|
||||
public val publicToInternalPAProperty1 = "Container.publicToInternalPAProperty1.v1"
|
||||
public val publicToInternalPAProperty2 get() = "Container.publicToInternalPAProperty2.v1"
|
||||
public val publicToPrivateProperty1 = "Container.publicToPrivateProperty1.v1"
|
||||
public val publicToPrivateProperty2 get() = "Container.publicToPrivateProperty2.v1"
|
||||
|
||||
@@ -15,6 +19,8 @@ open class Container {
|
||||
protected val protectedToPublicProperty2 get() = "Container.protectedToPublicProperty2.v1"
|
||||
protected val protectedToInternalProperty1 = "Container.protectedToInternalProperty1.v1"
|
||||
protected val protectedToInternalProperty2 get() = "Container.protectedToInternalProperty2.v1"
|
||||
protected val protectedToInternalPAProperty1 = "Container.protectedToInternalPAProperty1.v1"
|
||||
protected val protectedToInternalPAProperty2 get() = "Container.protectedToInternalPAProperty2.v1"
|
||||
protected val protectedToPrivateProperty1 = "Container.protectedToPrivateProperty1.v1"
|
||||
protected val protectedToPrivateProperty2 get() = "Container.protectedToPrivateProperty2.v1"
|
||||
|
||||
@@ -26,6 +32,10 @@ open class Container {
|
||||
public open val publicToInternalOverriddenProperty2 get() = "Container.publicToInternalOverriddenProperty2.v1"
|
||||
public open val publicToInternalOverriddenProperty3 = "Container.publicToInternalOverriddenProperty3.v1"
|
||||
public open val publicToInternalOverriddenProperty4 get() = "Container.publicToInternalOverriddenProperty4.v1"
|
||||
public open val publicToInternalPAOverriddenProperty1 = "Container.publicToInternalPAOverriddenProperty1.v1"
|
||||
public open val publicToInternalPAOverriddenProperty2 get() = "Container.publicToInternalPAOverriddenProperty2.v1"
|
||||
public open val publicToInternalPAOverriddenProperty3 = "Container.publicToInternalPAOverriddenProperty3.v1"
|
||||
public open val publicToInternalPAOverriddenProperty4 get() = "Container.publicToInternalPAOverriddenProperty4.v1"
|
||||
public open val publicToPrivateOverriddenProperty1 = "Container.publicToPrivateOverriddenProperty1.v1"
|
||||
public open val publicToPrivateOverriddenProperty2 get() = "Container.publicToPrivateOverriddenProperty2.v1"
|
||||
public open val publicToPrivateOverriddenProperty3 = "Container.publicToPrivateOverriddenProperty3.v1"
|
||||
@@ -39,6 +49,10 @@ open class Container {
|
||||
protected open val protectedToInternalOverriddenProperty2 get() = "Container.protectedToInternalOverriddenProperty2.v1"
|
||||
protected open val protectedToInternalOverriddenProperty3 = "Container.protectedToInternalOverriddenProperty3.v1"
|
||||
protected open val protectedToInternalOverriddenProperty4 get() = "Container.protectedToInternalOverriddenProperty4.v1"
|
||||
protected open val protectedToInternalPAOverriddenProperty1 = "Container.protectedToInternalPAOverriddenProperty1.v1"
|
||||
protected open val protectedToInternalPAOverriddenProperty2 get() = "Container.protectedToInternalPAOverriddenProperty2.v1"
|
||||
protected open val protectedToInternalPAOverriddenProperty3 = "Container.protectedToInternalPAOverriddenProperty3.v1"
|
||||
protected open val protectedToInternalPAOverriddenProperty4 get() = "Container.protectedToInternalPAOverriddenProperty4.v1"
|
||||
protected open val protectedToPrivateOverriddenProperty1 = "Container.protectedToPrivateOverriddenProperty1.v1"
|
||||
protected open val protectedToPrivateOverriddenProperty2 get() = "Container.protectedToPrivateOverriddenProperty2.v1"
|
||||
protected open val protectedToPrivateOverriddenProperty3 = "Container.protectedToPrivateOverriddenProperty3.v1"
|
||||
@@ -68,6 +82,14 @@ open class Container {
|
||||
// internal open val newOpenInternalProperty2 get() = "Container.newOpenInternalProperty2.v1"
|
||||
// internal open val newOpenInternalProperty3 = "Container.newOpenInternalProperty3.v1"
|
||||
// internal open val newOpenInternalProperty4 get() = "Container.newOpenInternalProperty4.v1"
|
||||
// internal val newInternalPAProperty1 = "Container.newInternalPAProperty1.v1"
|
||||
// internal val newInternalPAProperty2 get() = "Container.newInternalPAProperty2.v1"
|
||||
// internal val newInternalPAProperty3 = "Container.newInternalPAProperty3.v1"
|
||||
// internal val newInternalPAProperty4 get() = "Container.newInternalPAProperty4.v1"
|
||||
// internal open val newOpenInternalPAProperty1 = "Container.newOpenInternalPAProperty1.v1"
|
||||
// internal open val newOpenInternalPAProperty2 get() = "Container.newOpenInternalPAProperty2.v1"
|
||||
// internal open val newOpenInternalPAProperty3 = "Container.newOpenInternalPAProperty3.v1"
|
||||
// internal open val newOpenInternalPAProperty4 get() = "Container.newOpenInternalPAProperty4.v1"
|
||||
// private val newPrivateProperty1 = "Container.newPrivateProperty1.v1"
|
||||
// private val newPrivateProperty2 get() = "Container.newPrivateProperty2.v1"
|
||||
// private val newPrivateProperty3 = "Container.newPrivateProperty3.v1"
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
internal val publicToInternalTopLevelProperty1 = "publicToInternalTopLevelProperty1.v2"
|
||||
internal val publicToInternalTopLevelProperty2 get() = "publicToInternalTopLevelProperty2.v2"
|
||||
@PublishedApi internal val publicToInternalPATopLevelProperty1 = "publicToInternalPATopLevelProperty1.v2"
|
||||
@PublishedApi internal val publicToInternalPATopLevelProperty2 get() = "publicToInternalPATopLevelProperty2.v2"
|
||||
private val publicToPrivateTopLevelProperty1 = "publicToPrivateTopLevelProperty1.v2"
|
||||
private val publicToPrivateTopLevelProperty2 get() = "publicToPrivateTopLevelProperty2.v2"
|
||||
|
||||
@@ -8,6 +10,8 @@ open class Container {
|
||||
protected val publicToProtectedProperty2 get() = "Container.publicToProtectedProperty2.v2"
|
||||
internal val publicToInternalProperty1 = "Container.publicToInternalProperty1.v2"
|
||||
internal val publicToInternalProperty2 get() = "Container.publicToInternalProperty2.v2"
|
||||
@PublishedApi internal val publicToInternalPAProperty1 = "Container.publicToInternalPAProperty1.v2"
|
||||
@PublishedApi internal val publicToInternalPAProperty2 get() = "Container.publicToInternalPAProperty2.v2"
|
||||
private val publicToPrivateProperty1 = "Container.publicToPrivateProperty1.v2"
|
||||
private val publicToPrivateProperty2 get() = "Container.publicToPrivateProperty2.v2"
|
||||
|
||||
@@ -15,6 +19,8 @@ open class Container {
|
||||
public val protectedToPublicProperty2 get() = "Container.protectedToPublicProperty2.v2"
|
||||
internal val protectedToInternalProperty1 = "Container.protectedToInternalProperty1.v2"
|
||||
internal val protectedToInternalProperty2 get() = "Container.protectedToInternalProperty2.v2"
|
||||
@PublishedApi internal val protectedToInternalPAProperty1 = "Container.protectedToInternalPAProperty1.v2"
|
||||
@PublishedApi internal val protectedToInternalPAProperty2 get() = "Container.protectedToInternalPAProperty2.v2"
|
||||
private val protectedToPrivateProperty1 = "Container.protectedToPrivateProperty1.v2"
|
||||
private val protectedToPrivateProperty2 get() = "Container.protectedToPrivateProperty2.v2"
|
||||
|
||||
@@ -26,6 +32,10 @@ open class Container {
|
||||
internal open val publicToInternalOverriddenProperty2 get() = "Container.publicToInternalOverriddenProperty2.v2"
|
||||
internal open val publicToInternalOverriddenProperty3 get() = "Container.publicToInternalOverriddenProperty3.v2"
|
||||
internal open val publicToInternalOverriddenProperty4 = "Container.publicToInternalOverriddenProperty4.v2"
|
||||
@PublishedApi internal open val publicToInternalPAOverriddenProperty1 = "Container.publicToInternalPAOverriddenProperty1.v2"
|
||||
@PublishedApi internal open val publicToInternalPAOverriddenProperty2 get() = "Container.publicToInternalPAOverriddenProperty2.v2"
|
||||
@PublishedApi internal open val publicToInternalPAOverriddenProperty3 = "Container.publicToInternalPAOverriddenProperty3.v2"
|
||||
@PublishedApi internal open val publicToInternalPAOverriddenProperty4 get() = "Container.publicToInternalPAOverriddenProperty4.v2"
|
||||
private /*open*/ val publicToPrivateOverriddenProperty1 = "Container.publicToPrivateOverriddenProperty1.v2"
|
||||
private /*open*/ val publicToPrivateOverriddenProperty2 get() = "Container.publicToPrivateOverriddenProperty2.v2"
|
||||
private /*open*/ val publicToPrivateOverriddenProperty3 get() = "Container.publicToPrivateOverriddenProperty3.v2"
|
||||
@@ -39,6 +49,10 @@ open class Container {
|
||||
internal open val protectedToInternalOverriddenProperty2 get() = "Container.protectedToInternalOverriddenProperty2.v2"
|
||||
internal open val protectedToInternalOverriddenProperty3 get() = "Container.protectedToInternalOverriddenProperty3.v2"
|
||||
internal open val protectedToInternalOverriddenProperty4 = "Container.protectedToInternalOverriddenProperty4.v2"
|
||||
@PublishedApi internal open val protectedToInternalPAOverriddenProperty1 = "Container.protectedToInternalPAOverriddenProperty1.v2"
|
||||
@PublishedApi internal open val protectedToInternalPAOverriddenProperty2 get() = "Container.protectedToInternalPAOverriddenProperty2.v2"
|
||||
@PublishedApi internal open val protectedToInternalPAOverriddenProperty3 = "Container.protectedToInternalPAOverriddenProperty3.v2"
|
||||
@PublishedApi internal open val protectedToInternalPAOverriddenProperty4 get() = "Container.protectedToInternalPAOverriddenProperty4.v2"
|
||||
private /*open*/ val protectedToPrivateOverriddenProperty1 = "Container.protectedToPrivateOverriddenProperty1.v2"
|
||||
private /*open*/ val protectedToPrivateOverriddenProperty2 get() = "Container.protectedToPrivateOverriddenProperty2.v2"
|
||||
private /*open*/ val protectedToPrivateOverriddenProperty3 get() = "Container.protectedToPrivateOverriddenProperty3.v2"
|
||||
@@ -68,6 +82,14 @@ open class Container {
|
||||
internal open val newOpenInternalProperty2 get() = "Container.newOpenInternalProperty2.v2"
|
||||
internal open val newOpenInternalProperty3 = "Container.newOpenInternalProperty3.v2"
|
||||
internal open val newOpenInternalProperty4 get() = "Container.newOpenInternalProperty4.v2"
|
||||
@PublishedApi internal val newInternalPAProperty1 = "Container.newInternalPAProperty1.v2"
|
||||
@PublishedApi internal val newInternalPAProperty2 get() = "Container.newInternalPAProperty2.v2"
|
||||
@PublishedApi internal val newInternalPAProperty3 = "Container.newInternalPAProperty3.v2"
|
||||
@PublishedApi internal val newInternalPAProperty4 get() = "Container.newInternalPAProperty4.v2"
|
||||
@PublishedApi internal open val newOpenInternalPAProperty1 = "Container.newOpenInternalPAProperty1.v2"
|
||||
@PublishedApi internal open val newOpenInternalPAProperty2 get() = "Container.newOpenInternalPAProperty2.v2"
|
||||
@PublishedApi internal open val newOpenInternalPAProperty3 = "Container.newOpenInternalPAProperty3.v2"
|
||||
@PublishedApi internal open val newOpenInternalPAProperty4 get() = "Container.newOpenInternalPAProperty4.v2"
|
||||
private val newPrivateProperty1 = "Container.newPrivateProperty1.v2"
|
||||
private val newPrivateProperty2 get() = "Container.newPrivateProperty2.v2"
|
||||
private val newPrivateProperty3 = "Container.newPrivateProperty3.v2"
|
||||
|
||||
@@ -4,6 +4,8 @@ class ContainerImpl : Container() {
|
||||
fun publicToProtectedProperty2Access() = publicToProtectedProperty2
|
||||
fun publicToInternalProperty1Access() = publicToInternalProperty1
|
||||
fun publicToInternalProperty2Access() = publicToInternalProperty2
|
||||
fun publicToInternalPAProperty1Access() = publicToInternalPAProperty1
|
||||
fun publicToInternalPAProperty2Access() = publicToInternalPAProperty2
|
||||
fun publicToPrivateProperty1Access() = publicToPrivateProperty1
|
||||
fun publicToPrivateProperty2Access() = publicToPrivateProperty2
|
||||
|
||||
@@ -12,6 +14,8 @@ class ContainerImpl : Container() {
|
||||
fun protectedToPublicProperty2Access() = protectedToPublicProperty2
|
||||
fun protectedToInternalProperty1Access() = protectedToInternalProperty1
|
||||
fun protectedToInternalProperty2Access() = protectedToInternalProperty2
|
||||
fun protectedToInternalPAProperty1Access() = protectedToInternalPAProperty1
|
||||
fun protectedToInternalPAProperty2Access() = protectedToInternalPAProperty2
|
||||
fun protectedToPrivateProperty1Access() = protectedToPrivateProperty1
|
||||
fun protectedToPrivateProperty2Access() = protectedToPrivateProperty2
|
||||
|
||||
@@ -24,6 +28,10 @@ class ContainerImpl : Container() {
|
||||
override val publicToInternalOverriddenProperty2 get() = "ContainerImpl.publicToInternalOverriddenProperty2"
|
||||
override val publicToInternalOverriddenProperty3 get() = "ContainerImpl.publicToInternalOverriddenProperty3"
|
||||
override val publicToInternalOverriddenProperty4 = "ContainerImpl.publicToInternalOverriddenProperty4"
|
||||
override val publicToInternalPAOverriddenProperty1 = "ContainerImpl.publicToInternalPAOverriddenProperty1"
|
||||
override val publicToInternalPAOverriddenProperty2 get() = "ContainerImpl.publicToInternalPAOverriddenProperty2"
|
||||
override val publicToInternalPAOverriddenProperty3 get() = "ContainerImpl.publicToInternalPAOverriddenProperty3"
|
||||
override val publicToInternalPAOverriddenProperty4 = "ContainerImpl.publicToInternalPAOverriddenProperty4"
|
||||
override val publicToPrivateOverriddenProperty1 = "ContainerImpl.publicToPrivateOverriddenProperty1"
|
||||
override val publicToPrivateOverriddenProperty2 get() = "ContainerImpl.publicToPrivateOverriddenProperty2"
|
||||
override val publicToPrivateOverriddenProperty3 get() = "ContainerImpl.publicToPrivateOverriddenProperty3"
|
||||
@@ -37,6 +45,10 @@ class ContainerImpl : Container() {
|
||||
override val protectedToInternalOverriddenProperty2 get() = "ContainerImpl.protectedToInternalOverriddenProperty2"
|
||||
override val protectedToInternalOverriddenProperty3 get() = "ContainerImpl.protectedToInternalOverriddenProperty3"
|
||||
override val protectedToInternalOverriddenProperty4 = "ContainerImpl.protectedToInternalOverriddenProperty4"
|
||||
override val protectedToInternalPAOverriddenProperty1 = "ContainerImpl.protectedToInternalPAOverriddenProperty1"
|
||||
override val protectedToInternalPAOverriddenProperty2 get() = "ContainerImpl.protectedToInternalPAOverriddenProperty2"
|
||||
override val protectedToInternalPAOverriddenProperty3 get() = "ContainerImpl.protectedToInternalPAOverriddenProperty3"
|
||||
override val protectedToInternalPAOverriddenProperty4 = "ContainerImpl.protectedToInternalPAOverriddenProperty4"
|
||||
override val protectedToPrivateOverriddenProperty1 = "ContainerImpl.protectedToPrivateOverriddenProperty1"
|
||||
override val protectedToPrivateOverriddenProperty2 get() = "ContainerImpl.protectedToPrivateOverriddenProperty2"
|
||||
override val protectedToPrivateOverriddenProperty3 get() = "ContainerImpl.protectedToPrivateOverriddenProperty3"
|
||||
@@ -51,6 +63,10 @@ class ContainerImpl : Container() {
|
||||
fun protectedToInternalOverriddenProperty2Access() = protectedToInternalOverriddenProperty2
|
||||
fun protectedToInternalOverriddenProperty3Access() = protectedToInternalOverriddenProperty3
|
||||
fun protectedToInternalOverriddenProperty4Access() = protectedToInternalOverriddenProperty4
|
||||
fun protectedToInternalPAOverriddenProperty1Access() = protectedToInternalPAOverriddenProperty1
|
||||
fun protectedToInternalPAOverriddenProperty2Access() = protectedToInternalPAOverriddenProperty2
|
||||
fun protectedToInternalPAOverriddenProperty3Access() = protectedToInternalPAOverriddenProperty3
|
||||
fun protectedToInternalPAOverriddenProperty4Access() = protectedToInternalPAOverriddenProperty4
|
||||
fun protectedToPrivateOverriddenProperty1Access() = protectedToPrivateOverriddenProperty1
|
||||
fun protectedToPrivateOverriddenProperty2Access() = protectedToPrivateOverriddenProperty2
|
||||
fun protectedToPrivateOverriddenProperty3Access() = protectedToPrivateOverriddenProperty3
|
||||
@@ -81,6 +97,14 @@ class ContainerImpl : Container() {
|
||||
internal open val newOpenInternalProperty2 get() = "ContainerImpl.newOpenInternalProperty2"
|
||||
internal open val newOpenInternalProperty3 get() = "ContainerImpl.newOpenInternalProperty3"
|
||||
internal open val newOpenInternalProperty4 = "ContainerImpl.newOpenInternalProperty4"
|
||||
internal val newInternalPAProperty1 = "ContainerImpl.newInternalPAProperty1"
|
||||
internal val newInternalPAProperty2 get() = "ContainerImpl.newInternalPAProperty2"
|
||||
internal val newInternalPAProperty3 get() = "ContainerImpl.newInternalPAProperty3"
|
||||
internal val newInternalPAProperty4 = "ContainerImpl.newInternalPAProperty4"
|
||||
internal open val newOpenInternalPAProperty1 = "ContainerImpl.newOpenInternalPAProperty1"
|
||||
internal open val newOpenInternalPAProperty2 get() = "ContainerImpl.newOpenInternalPAProperty2"
|
||||
internal open val newOpenInternalPAProperty3 get() = "ContainerImpl.newOpenInternalPAProperty3"
|
||||
internal open val newOpenInternalPAProperty4 = "ContainerImpl.newOpenInternalPAProperty4"
|
||||
private val newPrivateProperty1 = "ContainerImpl.newPrivateProperty1"
|
||||
private val newPrivateProperty2 get() = "ContainerImpl.newPrivateProperty2"
|
||||
private val newPrivateProperty3 get() = "ContainerImpl.newPrivateProperty3"
|
||||
@@ -104,6 +128,14 @@ class ContainerImpl : Container() {
|
||||
fun newOpenInternalProperty2Access() = newOpenInternalProperty2
|
||||
fun newOpenInternalProperty3Access() = newOpenInternalProperty3
|
||||
fun newOpenInternalProperty4Access() = newOpenInternalProperty4
|
||||
fun newInternalPAProperty1Access() = newInternalPAProperty1
|
||||
fun newInternalPAProperty2Access() = newInternalPAProperty2
|
||||
fun newInternalPAProperty3Access() = newInternalPAProperty3
|
||||
fun newInternalPAProperty4Access() = newInternalPAProperty4
|
||||
fun newOpenInternalPAProperty1Access() = newOpenInternalPAProperty1
|
||||
fun newOpenInternalPAProperty2Access() = newOpenInternalPAProperty2
|
||||
fun newOpenInternalPAProperty3Access() = newOpenInternalPAProperty3
|
||||
fun newOpenInternalPAProperty4Access() = newOpenInternalPAProperty4
|
||||
fun newPrivateProperty1Access() = newPrivateProperty1
|
||||
fun newPrivateProperty2Access() = newPrivateProperty2
|
||||
fun newPrivateProperty3Access() = newPrivateProperty3
|
||||
|
||||
+127
-76
@@ -1,82 +1,133 @@
|
||||
import abitestutils.abiTest
|
||||
import abitestutils.TestBuilder
|
||||
import abitestutils.TestMode.NATIVE_CACHE_STATIC_EVERYWHERE
|
||||
|
||||
fun box() = abiTest {
|
||||
val c = Container()
|
||||
val ci = ContainerImpl()
|
||||
expectSuccess("publicToInternalTopLevelProperty1.v2") { publicToInternalTopLevelProperty1 }
|
||||
expectSuccess("publicToInternalTopLevelProperty2.v2") { publicToInternalTopLevelProperty2 }
|
||||
expectFailure(prefixed("property accessor publicToPrivateTopLevelProperty1.<get-publicToPrivateTopLevelProperty1> can not be called")) { publicToPrivateTopLevelProperty1 }
|
||||
expectFailure(prefixed("property accessor publicToPrivateTopLevelProperty2.<get-publicToPrivateTopLevelProperty2> can not be called")) { publicToPrivateTopLevelProperty2 }
|
||||
expectSuccess("Container.publicToProtectedProperty1.v2") { c.publicToProtectedProperty1 }
|
||||
expectSuccess("Container.publicToProtectedProperty1.v2") { ci.publicToProtectedProperty1 }
|
||||
expectSuccess("Container.publicToProtectedProperty2.v2") { c.publicToProtectedProperty2 }
|
||||
expectSuccess("Container.publicToProtectedProperty2.v2") { ci.publicToProtectedProperty2 }
|
||||
expectFailure(prefixed("property accessor publicToInternalProperty1.<get-publicToInternalProperty1> can not be called")) { c.publicToInternalProperty1 }
|
||||
expectFailure(prefixed("property accessor publicToInternalProperty1.<get-publicToInternalProperty1> can not be called")) { ci.publicToInternalProperty1 }
|
||||
expectFailure(prefixed("property accessor publicToInternalProperty2.<get-publicToInternalProperty2> can not be called")) { c.publicToInternalProperty2 }
|
||||
expectFailure(prefixed("property accessor publicToInternalProperty2.<get-publicToInternalProperty2> can not be called")) { ci.publicToInternalProperty2 }
|
||||
expectFailure(prefixed("property accessor publicToPrivateProperty1.<get-publicToPrivateProperty1> can not be called")) { c.publicToPrivateProperty1 }
|
||||
expectFailure(prefixed("property accessor publicToPrivateProperty1.<get-publicToPrivateProperty1> can not be called")) { ci.publicToPrivateProperty1 }
|
||||
expectFailure(prefixed("property accessor publicToPrivateProperty2.<get-publicToPrivateProperty2> can not be called")) { c.publicToPrivateProperty2 }
|
||||
expectFailure(prefixed("property accessor publicToPrivateProperty2.<get-publicToPrivateProperty2> can not be called")) { ci.publicToPrivateProperty2 }
|
||||
expectSuccess("Container.publicToProtectedProperty1.v2") { ci.publicToProtectedProperty1Access() }
|
||||
expectSuccess("Container.publicToProtectedProperty2.v2") { ci.publicToProtectedProperty2Access() }
|
||||
expectFailure(prefixed("property accessor publicToInternalProperty1.<get-publicToInternalProperty1> can not be called")) { ci.publicToInternalProperty1Access() }
|
||||
expectFailure(prefixed("property accessor publicToInternalProperty2.<get-publicToInternalProperty2> can not be called")) { ci.publicToInternalProperty2Access() }
|
||||
expectFailure(prefixed("property accessor publicToPrivateProperty1.<get-publicToPrivateProperty1> can not be called")) { ci.publicToPrivateProperty1Access() }
|
||||
expectFailure(prefixed("property accessor publicToPrivateProperty2.<get-publicToPrivateProperty2> can not be called")) { ci.publicToPrivateProperty2Access() }
|
||||
expectSuccess("Container.protectedToPublicProperty1.v2") { ci.protectedToPublicProperty1Access() }
|
||||
expectSuccess("Container.protectedToPublicProperty2.v2") { ci.protectedToPublicProperty2Access() }
|
||||
expectFailure(prefixed("property accessor protectedToInternalProperty1.<get-protectedToInternalProperty1> can not be called")) { ci.protectedToInternalProperty1Access() }
|
||||
expectFailure(prefixed("property accessor protectedToInternalProperty2.<get-protectedToInternalProperty2> can not be called")) { ci.protectedToInternalProperty2Access() }
|
||||
expectFailure(prefixed("property accessor protectedToPrivateProperty1.<get-protectedToPrivateProperty1> can not be called")) { ci.protectedToPrivateProperty1Access() }
|
||||
expectFailure(prefixed("property accessor protectedToPrivateProperty2.<get-protectedToPrivateProperty2> can not be called")) { ci.protectedToPrivateProperty2Access() }
|
||||
expectSuccess("ContainerImpl.publicToProtectedOverriddenProperty1") { ci.publicToProtectedOverriddenProperty1 }
|
||||
expectSuccess("ContainerImpl.publicToProtectedOverriddenProperty2") { ci.publicToProtectedOverriddenProperty2 }
|
||||
expectSuccess("ContainerImpl.publicToProtectedOverriddenProperty3") { ci.publicToProtectedOverriddenProperty3 }
|
||||
expectSuccess("ContainerImpl.publicToProtectedOverriddenProperty4") { ci.publicToProtectedOverriddenProperty4 }
|
||||
expectSuccess("ContainerImpl.publicToInternalOverriddenProperty1") { ci.publicToInternalOverriddenProperty1 }
|
||||
expectSuccess("ContainerImpl.publicToInternalOverriddenProperty2") { ci.publicToInternalOverriddenProperty2 }
|
||||
expectSuccess("ContainerImpl.publicToInternalOverriddenProperty3") { ci.publicToInternalOverriddenProperty3 }
|
||||
expectSuccess("ContainerImpl.publicToInternalOverriddenProperty4") { ci.publicToInternalOverriddenProperty4 }
|
||||
expectSuccess("ContainerImpl.publicToPrivateOverriddenProperty1") { ci.publicToPrivateOverriddenProperty1 }
|
||||
expectSuccess("ContainerImpl.publicToPrivateOverriddenProperty2") { ci.publicToPrivateOverriddenProperty2 }
|
||||
expectSuccess("ContainerImpl.publicToPrivateOverriddenProperty3") { ci.publicToPrivateOverriddenProperty3 }
|
||||
expectSuccess("ContainerImpl.publicToPrivateOverriddenProperty4") { ci.publicToPrivateOverriddenProperty4 }
|
||||
expectSuccess("ContainerImpl.protectedToPublicOverriddenProperty1") { ci.protectedToPublicOverriddenProperty1Access() }
|
||||
expectSuccess("ContainerImpl.protectedToPublicOverriddenProperty2") { ci.protectedToPublicOverriddenProperty2Access() }
|
||||
expectSuccess("ContainerImpl.protectedToPublicOverriddenProperty3") { ci.protectedToPublicOverriddenProperty3Access() }
|
||||
expectSuccess("ContainerImpl.protectedToPublicOverriddenProperty4") { ci.protectedToPublicOverriddenProperty4Access() }
|
||||
expectSuccess("ContainerImpl.protectedToInternalOverriddenProperty1") { ci.protectedToInternalOverriddenProperty1Access() }
|
||||
expectSuccess("ContainerImpl.protectedToInternalOverriddenProperty2") { ci.protectedToInternalOverriddenProperty2Access() }
|
||||
expectSuccess("ContainerImpl.protectedToInternalOverriddenProperty3") { ci.protectedToInternalOverriddenProperty3Access() }
|
||||
expectSuccess("ContainerImpl.protectedToInternalOverriddenProperty4") { ci.protectedToInternalOverriddenProperty4Access() }
|
||||
expectSuccess("ContainerImpl.protectedToPrivateOverriddenProperty1") { ci.protectedToPrivateOverriddenProperty1Access() }
|
||||
expectSuccess("ContainerImpl.protectedToPrivateOverriddenProperty2") { ci.protectedToPrivateOverriddenProperty2Access() }
|
||||
expectSuccess("ContainerImpl.protectedToPrivateOverriddenProperty3") { ci.protectedToPrivateOverriddenProperty3Access() }
|
||||
expectSuccess("ContainerImpl.protectedToPrivateOverriddenProperty4") { ci.protectedToPrivateOverriddenProperty4Access() }
|
||||
expectSuccess("ContainerImpl.newPublicProperty1") { ci.newPublicProperty1 }
|
||||
expectSuccess("ContainerImpl.newPublicProperty2") { ci.newPublicProperty2 }
|
||||
expectSuccess("ContainerImpl.newPublicProperty3") { ci.newPublicProperty3 }
|
||||
expectSuccess("ContainerImpl.newPublicProperty4") { ci.newPublicProperty4 }
|
||||
expectSuccess("ContainerImpl.newProtectedProperty1") { ci.newProtectedProperty1Access() }
|
||||
expectSuccess("ContainerImpl.newProtectedProperty2") { ci.newProtectedProperty2Access() }
|
||||
expectSuccess("ContainerImpl.newProtectedProperty3") { ci.newProtectedProperty3Access() }
|
||||
expectSuccess("ContainerImpl.newProtectedProperty4") { ci.newProtectedProperty4Access() }
|
||||
expectSuccess("ContainerImpl.newOpenProtectedProperty1") { ci.newOpenProtectedProperty1Access() }
|
||||
expectSuccess("ContainerImpl.newOpenProtectedProperty2") { ci.newOpenProtectedProperty2Access() }
|
||||
expectSuccess("ContainerImpl.newOpenProtectedProperty3") { ci.newOpenProtectedProperty3Access() }
|
||||
expectSuccess("ContainerImpl.newOpenProtectedProperty4") { ci.newOpenProtectedProperty4Access() }
|
||||
expectSuccess("ContainerImpl.newInternalProperty1") { ci.newInternalProperty1Access() }
|
||||
expectSuccess("ContainerImpl.newInternalProperty2") { ci.newInternalProperty2Access() }
|
||||
expectSuccess("ContainerImpl.newInternalProperty3") { ci.newInternalProperty3Access() }
|
||||
expectSuccess("ContainerImpl.newInternalProperty4") { ci.newInternalProperty4Access() }
|
||||
expectSuccess("ContainerImpl.newOpenInternalProperty1") { ci.newOpenInternalProperty1Access() }
|
||||
expectSuccess("ContainerImpl.newOpenInternalProperty2") { ci.newOpenInternalProperty2Access() }
|
||||
expectSuccess("ContainerImpl.newOpenInternalProperty3") { ci.newOpenInternalProperty3Access() }
|
||||
expectSuccess("ContainerImpl.newOpenInternalProperty4") { ci.newOpenInternalProperty4Access() }
|
||||
expectSuccess("ContainerImpl.newPrivateProperty1") { ci.newPrivateProperty1Access() }
|
||||
expectSuccess("ContainerImpl.newPrivateProperty2") { ci.newPrivateProperty2Access() }
|
||||
expectSuccess("ContainerImpl.newPrivateProperty3") { ci.newPrivateProperty3Access() }
|
||||
expectSuccess("ContainerImpl.newPrivateProperty4") { ci.newPrivateProperty4Access() }
|
||||
|
||||
success("publicToInternalTopLevelProperty1.v2") { publicToInternalTopLevelProperty1 } // Signature remains the same.
|
||||
success("publicToInternalTopLevelProperty2.v2") { publicToInternalTopLevelProperty2 } // Signature remains the same.
|
||||
success("publicToInternalPATopLevelProperty1.v2") { publicToInternalPATopLevelProperty1 } // Signature remains the same.
|
||||
success("publicToInternalPATopLevelProperty2.v2") { publicToInternalPATopLevelProperty2 } // Signature remains the same.
|
||||
unlinkedSymbol("/publicToPrivateTopLevelProperty1.<get-publicToPrivateTopLevelProperty1>") { publicToPrivateTopLevelProperty1 } // Signature changed.
|
||||
unlinkedSymbol("/publicToPrivateTopLevelProperty2.<get-publicToPrivateTopLevelProperty2>") { publicToPrivateTopLevelProperty2 } // Signature changed.
|
||||
|
||||
success("Container.publicToProtectedProperty1.v2") { c.publicToProtectedProperty1 } // Signature remains the same.
|
||||
success("Container.publicToProtectedProperty1.v2") { ci.publicToProtectedProperty1 } // Signature remains the same.
|
||||
success("Container.publicToProtectedProperty2.v2") { c.publicToProtectedProperty2 } // Signature remains the same.
|
||||
success("Container.publicToProtectedProperty2.v2") { ci.publicToProtectedProperty2 } // Signature remains the same.
|
||||
// TODO: KT-54469, Container.publicToInternalProperty1 should fail because it is accessed from another module.
|
||||
success("Container.publicToInternalProperty1.v2") { c.publicToInternalProperty1 } // Signature remains the same.
|
||||
unlinkedSymbol("/ContainerImpl.publicToInternalProperty1.<get-publicToInternalProperty1>") { ci.publicToInternalProperty1 } // FOs are not generated for internal members from other module.
|
||||
// TODO: KT-54469, Container.publicToInternalProperty2 should fail because it is accessed from another module.
|
||||
success("Container.publicToInternalProperty2.v2") { c.publicToInternalProperty2 } // Signature remains the same.
|
||||
unlinkedSymbol("/ContainerImpl.publicToInternalProperty2.<get-publicToInternalProperty2>") { ci.publicToInternalProperty2 } // FOs are not generated for internal members from other module.
|
||||
// TODO: KT-54469, Container.publicToInternalPAProperty1 should fail because it is accessed from another module.
|
||||
success("Container.publicToInternalPAProperty1.v2") { c.publicToInternalPAProperty1 } // Signature remains the same.
|
||||
unlinkedSymbol("/ContainerImpl.publicToInternalPAProperty1.<get-publicToInternalPAProperty1>") { ci.publicToInternalPAProperty1 } // FOs are not generated for internal members from other module.
|
||||
// TODO: KT-54469, Container.publicToInternalPAProperty2 should fail because it is accessed from another module.
|
||||
success("Container.publicToInternalPAProperty2.v2") { c.publicToInternalPAProperty2 } // Signature remains the same.
|
||||
unlinkedSymbol("/ContainerImpl.publicToInternalPAProperty2.<get-publicToInternalPAProperty2>") { ci.publicToInternalPAProperty2 } // FOs are not generated for internal members from other module.
|
||||
inaccessible("publicToPrivateProperty1.<get-publicToPrivateProperty1>") { c.publicToPrivateProperty1 } // Inaccessible from other module though signature remains the same.
|
||||
unlinkedSymbol("/ContainerImpl.publicToPrivateProperty1.<get-publicToPrivateProperty1>") { ci.publicToPrivateProperty1 } // FOs are not generated for private members.
|
||||
inaccessible("publicToPrivateProperty2.<get-publicToPrivateProperty2>") { c.publicToPrivateProperty2 } // Inaccessible from other module though signature remains the same.
|
||||
unlinkedSymbol("/ContainerImpl.publicToPrivateProperty2.<get-publicToPrivateProperty2>") { ci.publicToPrivateProperty2 } // FOs are not generated for private members.
|
||||
|
||||
success("Container.publicToProtectedProperty1.v2") { ci.publicToProtectedProperty1Access() } // Signature remains the same.
|
||||
success("Container.publicToProtectedProperty2.v2") { ci.publicToProtectedProperty2Access() } // Signature remains the same.
|
||||
unlinkedSymbol("/ContainerImpl.publicToInternalProperty1.<get-publicToInternalProperty1>") { ci.publicToInternalProperty1Access() } // FOs are not generated for internal members from other module.
|
||||
unlinkedSymbol("/ContainerImpl.publicToInternalProperty2.<get-publicToInternalProperty2>") { ci.publicToInternalProperty2Access() } // FOs are not generated for internal members from other module.
|
||||
unlinkedSymbol("/ContainerImpl.publicToInternalPAProperty1.<get-publicToInternalPAProperty1>") { ci.publicToInternalPAProperty1Access() } // FOs are not generated for internal members from other module.
|
||||
unlinkedSymbol("/ContainerImpl.publicToInternalPAProperty2.<get-publicToInternalPAProperty2>") { ci.publicToInternalPAProperty2Access() } // FOs are not generated for internal members from other module.
|
||||
unlinkedSymbol("/ContainerImpl.publicToPrivateProperty1.<get-publicToPrivateProperty1>") { ci.publicToPrivateProperty1Access() } // FOs are not generated for private members.
|
||||
unlinkedSymbol("/ContainerImpl.publicToPrivateProperty2.<get-publicToPrivateProperty2>") { ci.publicToPrivateProperty2Access() } // FOs are not generated for private members.
|
||||
success("Container.protectedToPublicProperty1.v2") { ci.protectedToPublicProperty1Access() } // Signature remains the same.
|
||||
success("Container.protectedToPublicProperty2.v2") { ci.protectedToPublicProperty2Access() } // Signature remains the same.
|
||||
unlinkedSymbol("/ContainerImpl.protectedToInternalProperty1.<get-protectedToInternalProperty1>") { ci.protectedToInternalProperty1Access() } // FOs are not generated for internal members from other module.
|
||||
unlinkedSymbol("/ContainerImpl.protectedToInternalProperty2.<get-protectedToInternalProperty2>") { ci.protectedToInternalProperty2Access() } // FOs are not generated for internal members from other module.
|
||||
unlinkedSymbol("/ContainerImpl.protectedToInternalPAProperty1.<get-protectedToInternalPAProperty1>") { ci.protectedToInternalPAProperty1Access() } // FOs are not generated for internal members from other module.
|
||||
unlinkedSymbol("/ContainerImpl.protectedToInternalPAProperty2.<get-protectedToInternalPAProperty2>") { ci.protectedToInternalPAProperty2Access() } // FOs are not generated for internal members from other module.
|
||||
unlinkedSymbol("/ContainerImpl.protectedToPrivateProperty1.<get-protectedToPrivateProperty1>") { ci.protectedToPrivateProperty1Access() } // FOs are not generated for private members.
|
||||
unlinkedSymbol("/ContainerImpl.protectedToPrivateProperty2.<get-protectedToPrivateProperty2>") { ci.protectedToPrivateProperty2Access() } // FOs are not generated for private members.
|
||||
|
||||
success("ContainerImpl.publicToProtectedOverriddenProperty1") { ci.publicToProtectedOverriddenProperty1 }
|
||||
success("ContainerImpl.publicToProtectedOverriddenProperty2") { ci.publicToProtectedOverriddenProperty2 }
|
||||
success("ContainerImpl.publicToProtectedOverriddenProperty3") { ci.publicToProtectedOverriddenProperty3 }
|
||||
success("ContainerImpl.publicToProtectedOverriddenProperty4") { ci.publicToProtectedOverriddenProperty4 }
|
||||
success("ContainerImpl.publicToInternalOverriddenProperty1") { ci.publicToInternalOverriddenProperty1 }
|
||||
success("ContainerImpl.publicToInternalOverriddenProperty2") { ci.publicToInternalOverriddenProperty2 }
|
||||
success("ContainerImpl.publicToInternalOverriddenProperty3") { ci.publicToInternalOverriddenProperty3 }
|
||||
success("ContainerImpl.publicToInternalOverriddenProperty4") { ci.publicToInternalOverriddenProperty4 }
|
||||
success("ContainerImpl.publicToInternalPAOverriddenProperty1") { ci.publicToInternalPAOverriddenProperty1 }
|
||||
success("ContainerImpl.publicToInternalPAOverriddenProperty2") { ci.publicToInternalPAOverriddenProperty2 }
|
||||
success("ContainerImpl.publicToInternalPAOverriddenProperty3") { ci.publicToInternalPAOverriddenProperty3 }
|
||||
success("ContainerImpl.publicToInternalPAOverriddenProperty4") { ci.publicToInternalPAOverriddenProperty4 }
|
||||
success("ContainerImpl.publicToPrivateOverriddenProperty1") { ci.publicToPrivateOverriddenProperty1 }
|
||||
success("ContainerImpl.publicToPrivateOverriddenProperty2") { ci.publicToPrivateOverriddenProperty2 }
|
||||
success("ContainerImpl.publicToPrivateOverriddenProperty3") { ci.publicToPrivateOverriddenProperty3 }
|
||||
success("ContainerImpl.publicToPrivateOverriddenProperty4") { ci.publicToPrivateOverriddenProperty4 }
|
||||
success("ContainerImpl.protectedToPublicOverriddenProperty1") { ci.protectedToPublicOverriddenProperty1Access() }
|
||||
success("ContainerImpl.protectedToPublicOverriddenProperty2") { ci.protectedToPublicOverriddenProperty2Access() }
|
||||
success("ContainerImpl.protectedToPublicOverriddenProperty3") { ci.protectedToPublicOverriddenProperty3Access() }
|
||||
success("ContainerImpl.protectedToPublicOverriddenProperty4") { ci.protectedToPublicOverriddenProperty4Access() }
|
||||
success("ContainerImpl.protectedToInternalOverriddenProperty1") { ci.protectedToInternalOverriddenProperty1Access() }
|
||||
success("ContainerImpl.protectedToInternalOverriddenProperty2") { ci.protectedToInternalOverriddenProperty2Access() }
|
||||
success("ContainerImpl.protectedToInternalOverriddenProperty3") { ci.protectedToInternalOverriddenProperty3Access() }
|
||||
success("ContainerImpl.protectedToInternalOverriddenProperty4") { ci.protectedToInternalOverriddenProperty4Access() }
|
||||
success("ContainerImpl.protectedToInternalPAOverriddenProperty1") { ci.protectedToInternalPAOverriddenProperty1Access() }
|
||||
success("ContainerImpl.protectedToInternalPAOverriddenProperty2") { ci.protectedToInternalPAOverriddenProperty2Access() }
|
||||
success("ContainerImpl.protectedToInternalPAOverriddenProperty3") { ci.protectedToInternalPAOverriddenProperty3Access() }
|
||||
success("ContainerImpl.protectedToInternalPAOverriddenProperty4") { ci.protectedToInternalPAOverriddenProperty4Access() }
|
||||
success("ContainerImpl.protectedToPrivateOverriddenProperty1") { ci.protectedToPrivateOverriddenProperty1Access() }
|
||||
success("ContainerImpl.protectedToPrivateOverriddenProperty2") { ci.protectedToPrivateOverriddenProperty2Access() }
|
||||
success("ContainerImpl.protectedToPrivateOverriddenProperty3") { ci.protectedToPrivateOverriddenProperty3Access() }
|
||||
success("ContainerImpl.protectedToPrivateOverriddenProperty4") { ci.protectedToPrivateOverriddenProperty4Access() }
|
||||
|
||||
success("ContainerImpl.newPublicProperty1") { ci.newPublicProperty1 }
|
||||
success("ContainerImpl.newPublicProperty2") { ci.newPublicProperty2 }
|
||||
success("ContainerImpl.newPublicProperty3") { ci.newPublicProperty3 }
|
||||
success("ContainerImpl.newPublicProperty4") { ci.newPublicProperty4 }
|
||||
success("ContainerImpl.newProtectedProperty1") { ci.newProtectedProperty1Access() }
|
||||
success("ContainerImpl.newProtectedProperty2") { ci.newProtectedProperty2Access() }
|
||||
success("ContainerImpl.newProtectedProperty3") { ci.newProtectedProperty3Access() }
|
||||
success("ContainerImpl.newProtectedProperty4") { ci.newProtectedProperty4Access() }
|
||||
success("ContainerImpl.newOpenProtectedProperty1") { ci.newOpenProtectedProperty1Access() }
|
||||
success("ContainerImpl.newOpenProtectedProperty2") { ci.newOpenProtectedProperty2Access() }
|
||||
success("ContainerImpl.newOpenProtectedProperty3") { ci.newOpenProtectedProperty3Access() }
|
||||
success("ContainerImpl.newOpenProtectedProperty4") { ci.newOpenProtectedProperty4Access() }
|
||||
success("ContainerImpl.newInternalProperty1") { ci.newInternalProperty1Access() }
|
||||
success("ContainerImpl.newInternalProperty2") { ci.newInternalProperty2Access() }
|
||||
success("ContainerImpl.newInternalProperty3") { ci.newInternalProperty3Access() }
|
||||
success("ContainerImpl.newInternalProperty4") { ci.newInternalProperty4Access() }
|
||||
success("ContainerImpl.newOpenInternalProperty1") { ci.newOpenInternalProperty1Access() }
|
||||
success("ContainerImpl.newOpenInternalProperty2") { ci.newOpenInternalProperty2Access() }
|
||||
success("ContainerImpl.newOpenInternalProperty3") { ci.newOpenInternalProperty3Access() }
|
||||
success("ContainerImpl.newOpenInternalProperty4") { ci.newOpenInternalProperty4Access() }
|
||||
success("ContainerImpl.newInternalPAProperty1") { ci.newInternalPAProperty1Access() }
|
||||
success("ContainerImpl.newInternalPAProperty2") { ci.newInternalPAProperty2Access() }
|
||||
success("ContainerImpl.newInternalPAProperty3") { ci.newInternalPAProperty3Access() }
|
||||
success("ContainerImpl.newInternalPAProperty4") { ci.newInternalPAProperty4Access() }
|
||||
success("ContainerImpl.newOpenInternalPAProperty1") { ci.newOpenInternalPAProperty1Access() }
|
||||
success("ContainerImpl.newOpenInternalPAProperty2") { ci.newOpenInternalPAProperty2Access() }
|
||||
success("ContainerImpl.newOpenInternalPAProperty3") { ci.newOpenInternalPAProperty3Access() }
|
||||
success("ContainerImpl.newOpenInternalPAProperty4") { ci.newOpenInternalPAProperty4Access() }
|
||||
success("ContainerImpl.newPrivateProperty1") { ci.newPrivateProperty1Access() }
|
||||
success("ContainerImpl.newPrivateProperty2") { ci.newPrivateProperty2Access() }
|
||||
success("ContainerImpl.newPrivateProperty3") { ci.newPrivateProperty3Access() }
|
||||
success("ContainerImpl.newPrivateProperty4") { ci.newPrivateProperty4Access() }
|
||||
}
|
||||
|
||||
// Shortcuts:
|
||||
private inline fun TestBuilder.success(expectedOutcome: String, noinline block: () -> String) =
|
||||
expectSuccess(expectedOutcome, block)
|
||||
|
||||
private inline fun TestBuilder.unlinkedSymbol(signature: String, noinline block: () -> Unit) {
|
||||
val accessorName = signature.removePrefix("/").split('.').takeLast(2).joinToString(".")
|
||||
expectFailure(linkage("Property accessor '$accessorName' can not be called: No property accessor found for symbol '$signature'"), block)
|
||||
}
|
||||
|
||||
private inline fun TestBuilder.inaccessible(accessorName: String, noinline block: () -> Unit) = expectFailure(
|
||||
linkage("Property accessor '$accessorName' can not be called: Private property accessor declared in module <lib1> can not be accessed in module <main>"),
|
||||
block
|
||||
)
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
MUTED
|
||||
MODULES: lib1, lib2, main
|
||||
|
||||
STEP 0:
|
||||
|
||||
@@ -0,0 +1,143 @@
|
||||
class ClassToEnum {
|
||||
class Foo
|
||||
object Bar
|
||||
inner class Baz
|
||||
}
|
||||
|
||||
object ObjectToEnum {
|
||||
class Foo
|
||||
object Bar
|
||||
}
|
||||
|
||||
enum class EnumToClass {
|
||||
Foo,
|
||||
Bar,
|
||||
Baz
|
||||
}
|
||||
|
||||
enum class EnumToObject {
|
||||
Foo,
|
||||
Bar
|
||||
}
|
||||
|
||||
class ClassToObject
|
||||
object ObjectToClass
|
||||
|
||||
class ClassToInterface
|
||||
|
||||
class NestedObjectToCompanion1 {
|
||||
object Companion {
|
||||
fun name() = "NestedObjectToCompanion1.Companion"
|
||||
override fun toString() = name()
|
||||
}
|
||||
}
|
||||
|
||||
class NestedObjectToCompanion2 {
|
||||
object Foo {
|
||||
fun name() = "NestedObjectToCompanion2.Foo"
|
||||
override fun toString() = name()
|
||||
}
|
||||
}
|
||||
|
||||
class CompanionToNestedObject1 {
|
||||
companion object {
|
||||
fun name() = "CompanionToNestedObject1.Companion"
|
||||
override fun toString() = name()
|
||||
}
|
||||
}
|
||||
|
||||
class CompanionToNestedObject2 {
|
||||
companion object Foo {
|
||||
fun name() = "CompanionToNestedObject2.Foo"
|
||||
override fun toString() = name()
|
||||
}
|
||||
}
|
||||
|
||||
class CompanionAndNestedObjectsSwap {
|
||||
companion object Foo {
|
||||
fun name() = "Foo"
|
||||
}
|
||||
|
||||
object Bar {
|
||||
fun name() = "Bar"
|
||||
}
|
||||
}
|
||||
|
||||
class NestedClassContainer {
|
||||
fun name() = "NestedClassContainer"
|
||||
|
||||
class NestedToInner {
|
||||
fun name() = "NestedClassContainer.NestedToInner"
|
||||
override fun toString() = name()
|
||||
|
||||
object Object {
|
||||
fun name() = "NestedClassContainer.NestedToInner.Object"
|
||||
override fun toString() = name()
|
||||
}
|
||||
|
||||
companion object Companion {
|
||||
fun name() = "NestedClassContainer.NestedToInner.Companion"
|
||||
override fun toString() = name()
|
||||
}
|
||||
|
||||
class Nested {
|
||||
fun name() = "NestedClassContainer.NestedToInner.Nested"
|
||||
override fun toString() = name()
|
||||
}
|
||||
|
||||
inner class Inner {
|
||||
fun name() = this@NestedToInner.name() + ".Inner"
|
||||
override fun toString() = name()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class InnerClassContainer {
|
||||
fun name() = "InnerClassContainer"
|
||||
|
||||
inner class InnerToNested {
|
||||
fun name() = this@InnerClassContainer.name() + ".InnerToNested"
|
||||
override fun toString() = name()
|
||||
|
||||
inner class /*object*/ Object {
|
||||
fun name() = this@InnerToNested.name() + ".Object"
|
||||
override fun toString() = name()
|
||||
}
|
||||
|
||||
inner class /*companion object*/ Companion {
|
||||
fun name() = this@InnerToNested.name() + ".Companion"
|
||||
override fun toString() = name()
|
||||
}
|
||||
|
||||
inner class /*class*/ Nested {
|
||||
fun name() = this@InnerToNested.name() + ".Nested"
|
||||
override fun toString() = name()
|
||||
}
|
||||
|
||||
inner class Inner {
|
||||
fun name() = this@InnerToNested.name() + ".Inner"
|
||||
override fun toString() = name()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
annotation class AnnotationClassWithChangedParameterType(val x: Int)
|
||||
annotation class AnnotationClassThatBecomesRegularClass(val x: Int)
|
||||
annotation class AnnotationClassThatDisappears(val x: Int)
|
||||
annotation class AnnotationClassWithRenamedParameters(val i: Int, val s: String)
|
||||
annotation class AnnotationClassWithReorderedParameters(val i: Int, val s: String)
|
||||
annotation class AnnotationClassWithNewParameter(val i: Int)
|
||||
|
||||
value class ValueToClass(val x: Int)
|
||||
class ClassToValue(val x: Int)
|
||||
|
||||
data class DataToClass(val x: Int, val y: Int)
|
||||
|
||||
fun interface FunctionalInterfaceToInterface {
|
||||
fun work()
|
||||
}
|
||||
|
||||
class ClassToAbstractClass {
|
||||
var name: String = "Alice"
|
||||
fun getGreeting() = "Hello, $name!"
|
||||
}
|
||||
@@ -0,0 +1,143 @@
|
||||
enum class ClassToEnum {
|
||||
Foo,
|
||||
Bar,
|
||||
Baz
|
||||
}
|
||||
|
||||
enum class ObjectToEnum {
|
||||
Foo,
|
||||
Bar
|
||||
}
|
||||
|
||||
class EnumToClass {
|
||||
class Foo
|
||||
object Bar
|
||||
inner class Baz
|
||||
}
|
||||
|
||||
object EnumToObject {
|
||||
class Foo
|
||||
object Bar
|
||||
}
|
||||
|
||||
object ClassToObject
|
||||
class ObjectToClass
|
||||
|
||||
interface ClassToInterface
|
||||
|
||||
class NestedObjectToCompanion1 {
|
||||
companion object {
|
||||
fun name() = "NestedObjectToCompanion1.Companion"
|
||||
override fun toString() = name()
|
||||
}
|
||||
}
|
||||
|
||||
class NestedObjectToCompanion2 {
|
||||
companion object Foo {
|
||||
fun name() = "NestedObjectToCompanion2.Foo"
|
||||
override fun toString() = name()
|
||||
}
|
||||
}
|
||||
|
||||
class CompanionToNestedObject1 {
|
||||
object Companion {
|
||||
fun name() = "CompanionToNestedObject1.Companion"
|
||||
override fun toString() = name()
|
||||
}
|
||||
}
|
||||
|
||||
class CompanionToNestedObject2 {
|
||||
object Foo {
|
||||
fun name() = "CompanionToNestedObject2.Foo"
|
||||
override fun toString() = name()
|
||||
}
|
||||
}
|
||||
|
||||
class CompanionAndNestedObjectsSwap {
|
||||
object Foo {
|
||||
fun name() = "Foo"
|
||||
}
|
||||
|
||||
companion object Bar {
|
||||
fun name() = "Bar"
|
||||
}
|
||||
}
|
||||
|
||||
class NestedClassContainer {
|
||||
fun name() = "NestedClassContainer"
|
||||
|
||||
inner class NestedToInner {
|
||||
fun name() = this@NestedClassContainer.name() + ".NestedToInner"
|
||||
override fun toString() = name()
|
||||
|
||||
inner class /*object*/ Object {
|
||||
fun name() = this@NestedToInner.name() + ".Object"
|
||||
override fun toString() = name()
|
||||
}
|
||||
|
||||
inner class /*companion object*/ Companion {
|
||||
fun name() = this@NestedToInner.name() + ".Companion"
|
||||
override fun toString() = name()
|
||||
}
|
||||
|
||||
inner class /*class*/ Nested {
|
||||
fun name() = this@NestedToInner.name() + ".Nested"
|
||||
override fun toString() = name()
|
||||
}
|
||||
|
||||
inner class Inner {
|
||||
fun name() = this@NestedToInner.name() + ".Inner"
|
||||
override fun toString() = name()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class InnerClassContainer {
|
||||
fun name() = "InnerClassContainer"
|
||||
|
||||
class InnerToNested {
|
||||
fun name() = "InnerClassContainer.InnerToNested"
|
||||
override fun toString() = name()
|
||||
|
||||
object Object {
|
||||
fun name() = "InnerClassContainer.InnerToNested.Companion"
|
||||
override fun toString() = name()
|
||||
}
|
||||
|
||||
companion object Companion {
|
||||
fun name() = "InnerClassContainer.InnerToNested.Companion"
|
||||
override fun toString() = name()
|
||||
}
|
||||
|
||||
class Nested {
|
||||
fun name() = "InnerClassContainer.InnerToNested.Nested"
|
||||
override fun toString() = name()
|
||||
}
|
||||
|
||||
inner class Inner {
|
||||
fun name() = this@InnerToNested.name() + ".Inner"
|
||||
override fun toString() = name()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
annotation class AnnotationClassWithChangedParameterType(val x: /*Int*/ String)
|
||||
/*annotation*/ class AnnotationClassThatBecomesRegularClass(val x: Int) { override fun toString() = "AnnotationClassThatBecomesRegularClass[x=$x]" }
|
||||
//annotation class AnnotationClassThatDisappears(val x: Int)
|
||||
annotation class AnnotationClassWithRenamedParameters(val xi: Int, val xs: String)
|
||||
annotation class AnnotationClassWithReorderedParameters(val s: String, val i: Int)
|
||||
annotation class AnnotationClassWithNewParameter(val i: Int, val s: String = "Apple")
|
||||
|
||||
class ValueToClass(val x: Int)
|
||||
value class ClassToValue(val x: Int)
|
||||
|
||||
/*data*/ class DataToClass(val x: Int, val y: Int)
|
||||
|
||||
/*fun*/ interface FunctionalInterfaceToInterface {
|
||||
fun work()
|
||||
}
|
||||
|
||||
abstract class ClassToAbstractClass {
|
||||
abstract var name: String
|
||||
fun getGreeting() = "Hello, $name!"
|
||||
}
|
||||
@@ -0,0 +1,222 @@
|
||||
fun getClassToEnumFoo(): ClassToEnum.Foo = ClassToEnum.Foo()
|
||||
inline fun getClassToEnumFooInline(): ClassToEnum.Foo = ClassToEnum.Foo()
|
||||
fun getClassToEnumFooAsAny(): Any = ClassToEnum.Foo()
|
||||
inline fun getClassToEnumFooAsAnyInline(): Any = ClassToEnum.Foo()
|
||||
|
||||
fun getClassToEnumBar(): ClassToEnum.Bar = ClassToEnum.Bar
|
||||
inline fun getClassToEnumBarInline(): ClassToEnum.Bar = ClassToEnum.Bar
|
||||
fun getClassToEnumBarAsAny(): Any = ClassToEnum.Bar
|
||||
inline fun getClassToEnumBarAsAnyInline(): Any = ClassToEnum.Bar
|
||||
|
||||
fun getClassToEnumBaz(): ClassToEnum.Baz = ClassToEnum().Baz()
|
||||
inline fun getClassToEnumBazInline(): ClassToEnum.Baz = ClassToEnum().Baz()
|
||||
fun getClassToEnumBazAsAny(): Any = ClassToEnum().Baz()
|
||||
inline fun getClassToEnumBazAsAnyInline(): Any = ClassToEnum().Baz()
|
||||
|
||||
fun getObjectToEnumFoo(): ObjectToEnum.Foo = ObjectToEnum.Foo()
|
||||
inline fun getObjectToEnumFooInline(): ObjectToEnum.Foo = ObjectToEnum.Foo()
|
||||
fun getObjectToEnumFooAsAny(): Any = ObjectToEnum.Foo()
|
||||
inline fun getObjectToEnumFooAsAnyInline(): Any = ObjectToEnum.Foo()
|
||||
|
||||
fun getObjectToEnumBar(): ObjectToEnum.Bar = ObjectToEnum.Bar
|
||||
inline fun getObjectToEnumBarInline(): ObjectToEnum.Bar = ObjectToEnum.Bar
|
||||
fun getObjectToEnumBarAsAny(): Any = ObjectToEnum.Bar
|
||||
inline fun getObjectToEnumBarAsAnyInline(): Any = ObjectToEnum.Bar
|
||||
|
||||
fun getEnumToClassFoo(): EnumToClass = EnumToClass.Foo
|
||||
inline fun getEnumToClassFooInline(): EnumToClass = EnumToClass.Foo
|
||||
fun getEnumToClassFooAsAny(): Any = EnumToClass.Foo
|
||||
inline fun getEnumToClassFooAsAnyInline(): Any = EnumToClass.Foo
|
||||
|
||||
fun getEnumToClassBar(): EnumToClass = EnumToClass.Bar
|
||||
inline fun getEnumToClassBarInline(): EnumToClass = EnumToClass.Bar
|
||||
fun getEnumToClassBarAsAny(): Any = EnumToClass.Bar
|
||||
inline fun getEnumToClassBarAsAnyInline(): Any = EnumToClass.Bar
|
||||
|
||||
fun getEnumToClassBaz(): EnumToClass = EnumToClass.Baz
|
||||
inline fun getEnumToClassBazInline(): EnumToClass = EnumToClass.Baz
|
||||
fun getEnumToClassBazAsAny(): Any = EnumToClass.Baz
|
||||
inline fun getEnumToClassBazAsAnyInline(): Any = EnumToClass.Baz
|
||||
|
||||
fun getEnumToObjectFoo(): EnumToObject = EnumToObject.Foo
|
||||
inline fun getEnumToObjectFooInline(): EnumToObject = EnumToObject.Foo
|
||||
fun getEnumToObjectFooAsAny(): Any = EnumToObject.Foo
|
||||
inline fun getEnumToObjectFooAsAnyInline(): Any = EnumToObject.Foo
|
||||
|
||||
fun getEnumToObjectBar(): EnumToObject = EnumToObject.Bar
|
||||
inline fun getEnumToObjectBarInline(): EnumToObject = EnumToObject.Bar
|
||||
fun getEnumToObjectBarAsAny(): Any = EnumToObject.Bar
|
||||
inline fun getEnumToObjectBarAsAnyInline(): Any = EnumToObject.Bar
|
||||
|
||||
fun getClassToObject(): ClassToObject = ClassToObject()
|
||||
inline fun getClassToObjectInline(): ClassToObject = ClassToObject()
|
||||
fun getClassToObjectAsAny(): Any = ClassToObject()
|
||||
inline fun getClassToObjectAsAnyInline(): Any = ClassToObject()
|
||||
|
||||
fun getObjectToClass(): ObjectToClass = ObjectToClass
|
||||
inline fun getObjectToClassInline(): ObjectToClass = ObjectToClass
|
||||
fun getObjectToClassAsAny(): Any = ObjectToClass
|
||||
inline fun getObjectToClassAsAnyInline(): Any = ObjectToClass
|
||||
|
||||
fun getClassToInterface(): ClassToInterface = ClassToInterface()
|
||||
inline fun getClassToInterfaceInline(): ClassToInterface = ClassToInterface()
|
||||
fun getClassToInterfaceAsAny(): Any = ClassToInterface()
|
||||
inline fun getClassToInterfaceAsAnyInline(): Any = ClassToInterface()
|
||||
|
||||
fun getNestedObjectToCompanion1(): NestedObjectToCompanion1.Companion = NestedObjectToCompanion1.Companion
|
||||
inline fun getNestedObjectToCompanion1Inline(): NestedObjectToCompanion1.Companion = NestedObjectToCompanion1.Companion
|
||||
fun getNestedObjectToCompanion1AsAny(): Any = NestedObjectToCompanion1.Companion
|
||||
inline fun getNestedObjectToCompanion1AsAnyInline(): Any = NestedObjectToCompanion1.Companion
|
||||
|
||||
fun getNestedObjectToCompanion2(): NestedObjectToCompanion2.Foo = NestedObjectToCompanion2.Foo
|
||||
inline fun getNestedObjectToCompanion2Inline(): NestedObjectToCompanion2.Foo = NestedObjectToCompanion2.Foo
|
||||
fun getNestedObjectToCompanion2AsAny(): Any = NestedObjectToCompanion2.Foo
|
||||
inline fun getNestedObjectToCompanion2AsAnyInline(): Any = NestedObjectToCompanion2.Foo
|
||||
|
||||
fun getCompanionToNestedObject1(): CompanionToNestedObject1.Companion = CompanionToNestedObject1.Companion
|
||||
inline fun getCompanionToNestedObject1Inline(): CompanionToNestedObject1.Companion = CompanionToNestedObject1.Companion
|
||||
fun getCompanionToNestedObject1AsAny(): Any = CompanionToNestedObject1.Companion
|
||||
inline fun getCompanionToNestedObject1AsAnyInline(): Any = CompanionToNestedObject1.Companion
|
||||
fun getCompanionToNestedObject1Name(): String = CompanionToNestedObject1.Companion.name()
|
||||
inline fun getCompanionToNestedObject1NameInline(): String = CompanionToNestedObject1.Companion.name()
|
||||
fun getCompanionToNestedObject1NameShort(): String = CompanionToNestedObject1.name() // "Companion" is omit
|
||||
inline fun getCompanionToNestedObject1NameShortInline(): String = CompanionToNestedObject1.name() // "Companion" is omit
|
||||
|
||||
fun getCompanionToNestedObject2(): CompanionToNestedObject2.Foo = CompanionToNestedObject2.Foo
|
||||
inline fun getCompanionToNestedObject2Inline(): CompanionToNestedObject2.Foo = CompanionToNestedObject2.Foo
|
||||
fun getCompanionToNestedObject2AsAny(): Any = CompanionToNestedObject2.Foo
|
||||
inline fun getCompanionToNestedObject2AsAnyInline(): Any = CompanionToNestedObject2.Foo
|
||||
fun getCompanionToNestedObject2Name(): String = CompanionToNestedObject2.Foo.name()
|
||||
inline fun getCompanionToNestedObject2NameInline(): String = CompanionToNestedObject2.Foo.name()
|
||||
fun getCompanionToNestedObject2NameShort(): String = CompanionToNestedObject2.name() // "Foo" is omit
|
||||
inline fun getCompanionToNestedObject2NameShortInline(): String = CompanionToNestedObject2.name() // "Foo" is omit
|
||||
|
||||
fun getCompanionAndNestedObjectsSwap(): String = CompanionAndNestedObjectsSwap.name() // companion object name is omit
|
||||
inline fun getCompanionAndNestedObjectsSwapInline(): String = CompanionAndNestedObjectsSwap.name() // companion object name is omit
|
||||
|
||||
fun getNestedToInnerName() = NestedClassContainer.NestedToInner().name()
|
||||
inline fun getNestedToInnerNameInline() = NestedClassContainer.NestedToInner().name()
|
||||
fun getNestedToInnerObjectName() = NestedClassContainer.NestedToInner.Object.name()
|
||||
inline fun getNestedToInnerObjectNameInline() = NestedClassContainer.NestedToInner.Object.name()
|
||||
fun getNestedToInnerCompanionName() = NestedClassContainer.NestedToInner.name()
|
||||
inline fun getNestedToInnerCompanionNameInline() = NestedClassContainer.NestedToInner.name()
|
||||
fun getNestedToInnerNestedName() = NestedClassContainer.NestedToInner.Nested().name()
|
||||
inline fun getNestedToInnerNestedNameInline() = NestedClassContainer.NestedToInner.Nested().name()
|
||||
fun getNestedToInnerInnerName() = NestedClassContainer.NestedToInner().Inner().name()
|
||||
inline fun getNestedToInnerInnerNameInline() = NestedClassContainer.NestedToInner().Inner().name()
|
||||
|
||||
fun getInnerToNestedName() = InnerClassContainer().InnerToNested().name()
|
||||
inline fun getInnerToNestedNameInline() = InnerClassContainer().InnerToNested().name()
|
||||
fun getInnerToNestedObjectName() = InnerClassContainer().InnerToNested().Object().name()
|
||||
inline fun getInnerToNestedObjectNameInline() = InnerClassContainer().InnerToNested().Object().name()
|
||||
fun getInnerToNestedCompanionName() = InnerClassContainer().InnerToNested().Companion().name()
|
||||
inline fun getInnerToNestedCompanionNameInline() = InnerClassContainer().InnerToNested().Companion().name()
|
||||
fun getInnerToNestedNestedName() = InnerClassContainer().InnerToNested().Nested().name()
|
||||
inline fun getInnerToNestedNestedNameInline() = InnerClassContainer().InnerToNested().Nested().name()
|
||||
fun getInnerToNestedInnerName() = InnerClassContainer().InnerToNested().Inner().name()
|
||||
inline fun getInnerToNestedInnerNameInline() = InnerClassContainer().InnerToNested().Inner().name()
|
||||
|
||||
annotation class AnnotationClassWithParameterThatBecomesRegularClass(val x: AnnotationClassThatBecomesRegularClass)
|
||||
annotation class AnnotationClassWithParameterOfParameterThatBecomesRegularClass(val x: AnnotationClassWithParameterThatBecomesRegularClass)
|
||||
annotation class AnnotationClassWithParameterThatDisappears(val x: AnnotationClassThatDisappears)
|
||||
annotation class AnnotationClassWithParameterOfParameterThatDisappears(val x: AnnotationClassWithParameterThatDisappears)
|
||||
|
||||
fun getAnnotationClassWithChangedParameterType(): AnnotationClassWithChangedParameterType = AnnotationClassWithChangedParameterType(101)
|
||||
inline fun getAnnotationClassWithChangedParameterTypeInline(): AnnotationClassWithChangedParameterType = AnnotationClassWithChangedParameterType(102)
|
||||
fun getAnnotationClassWithChangedParameterTypeAsAny(): Any = AnnotationClassWithChangedParameterType(103)
|
||||
inline fun getAnnotationClassWithChangedParameterTypeAsAnyInline(): Any = AnnotationClassWithChangedParameterType(104)
|
||||
fun getAnnotationClassThatBecomesRegularClass(): AnnotationClassThatBecomesRegularClass = AnnotationClassThatBecomesRegularClass(105)
|
||||
inline fun getAnnotationClassThatBecomesRegularClassInline(): AnnotationClassThatBecomesRegularClass = AnnotationClassThatBecomesRegularClass(106)
|
||||
fun getAnnotationClassThatBecomesRegularClassAsAny(): Any = AnnotationClassThatBecomesRegularClass(107)
|
||||
inline fun getAnnotationClassThatBecomesRegularClassAsAnyInline(): Any = AnnotationClassThatBecomesRegularClass(108)
|
||||
fun getAnnotationClassWithParameterThatBecomesRegularClass(): AnnotationClassWithParameterThatBecomesRegularClass = AnnotationClassWithParameterThatBecomesRegularClass(AnnotationClassThatBecomesRegularClass(109))
|
||||
inline fun getAnnotationClassWithParameterThatBecomesRegularClassInline(): AnnotationClassWithParameterThatBecomesRegularClass = AnnotationClassWithParameterThatBecomesRegularClass(AnnotationClassThatBecomesRegularClass(110))
|
||||
fun getAnnotationClassWithParameterThatBecomesRegularClassAsAny(): Any = AnnotationClassWithParameterThatBecomesRegularClass(AnnotationClassThatBecomesRegularClass(111))
|
||||
inline fun getAnnotationClassWithParameterThatBecomesRegularClassAsAnyInline(): Any = AnnotationClassWithParameterThatBecomesRegularClass(AnnotationClassThatBecomesRegularClass(112))
|
||||
fun getAnnotationClassWithParameterOfParameterThatBecomesRegularClass(): AnnotationClassWithParameterOfParameterThatBecomesRegularClass = AnnotationClassWithParameterOfParameterThatBecomesRegularClass(AnnotationClassWithParameterThatBecomesRegularClass(AnnotationClassThatBecomesRegularClass(113)))
|
||||
inline fun getAnnotationClassWithParameterOfParameterThatBecomesRegularClassInline(): AnnotationClassWithParameterOfParameterThatBecomesRegularClass = AnnotationClassWithParameterOfParameterThatBecomesRegularClass(AnnotationClassWithParameterThatBecomesRegularClass(AnnotationClassThatBecomesRegularClass(114)))
|
||||
fun getAnnotationClassWithParameterOfParameterThatBecomesRegularClassAsAny(): Any = AnnotationClassWithParameterOfParameterThatBecomesRegularClass(AnnotationClassWithParameterThatBecomesRegularClass(AnnotationClassThatBecomesRegularClass(115)))
|
||||
inline fun getAnnotationClassWithParameterOfParameterThatBecomesRegularClassAsAnyInline(): Any = AnnotationClassWithParameterOfParameterThatBecomesRegularClass(AnnotationClassWithParameterThatBecomesRegularClass(AnnotationClassThatBecomesRegularClass(116)))
|
||||
fun getAnnotationClassThatDisappears(): AnnotationClassThatDisappears = AnnotationClassThatDisappears(117)
|
||||
inline fun getAnnotationClassThatDisappearsInline(): AnnotationClassThatDisappears = AnnotationClassThatDisappears(118)
|
||||
fun getAnnotationClassThatDisappearsAsAny(): Any = AnnotationClassThatDisappears(119)
|
||||
inline fun getAnnotationClassThatDisappearsAsAnyInline(): Any = AnnotationClassThatDisappears(120)
|
||||
fun getAnnotationClassWithParameterThatDisappears(): AnnotationClassWithParameterThatDisappears = AnnotationClassWithParameterThatDisappears(AnnotationClassThatDisappears(121))
|
||||
inline fun getAnnotationClassWithParameterThatDisappearsInline(): AnnotationClassWithParameterThatDisappears = AnnotationClassWithParameterThatDisappears(AnnotationClassThatDisappears(122))
|
||||
fun getAnnotationClassWithParameterThatDisappearsAsAny(): Any = AnnotationClassWithParameterThatDisappears(AnnotationClassThatDisappears(123))
|
||||
inline fun getAnnotationClassWithParameterThatDisappearsAsAnyInline(): Any = AnnotationClassWithParameterThatDisappears(AnnotationClassThatDisappears(124))
|
||||
fun getAnnotationClassWithParameterOfParameterThatDisappears(): AnnotationClassWithParameterOfParameterThatDisappears = AnnotationClassWithParameterOfParameterThatDisappears(AnnotationClassWithParameterThatDisappears(AnnotationClassThatDisappears(125)))
|
||||
inline fun getAnnotationClassWithParameterOfParameterThatDisappearsInline(): AnnotationClassWithParameterOfParameterThatDisappears = AnnotationClassWithParameterOfParameterThatDisappears(AnnotationClassWithParameterThatDisappears(AnnotationClassThatDisappears(126)))
|
||||
fun getAnnotationClassWithParameterOfParameterThatDisappearsAsAny(): Any = AnnotationClassWithParameterOfParameterThatDisappears(AnnotationClassWithParameterThatDisappears(AnnotationClassThatDisappears(127)))
|
||||
inline fun getAnnotationClassWithParameterOfParameterThatDisappearsAsAnyInline(): Any = AnnotationClassWithParameterOfParameterThatDisappears(AnnotationClassWithParameterThatDisappears(AnnotationClassThatDisappears(128)))
|
||||
fun getAnnotationClassWithRenamedParameters(): AnnotationClassWithRenamedParameters = AnnotationClassWithRenamedParameters(129, "Banana")
|
||||
inline fun getAnnotationClassWithRenamedParametersInline(): AnnotationClassWithRenamedParameters = AnnotationClassWithRenamedParameters(130, "Pear")
|
||||
fun getAnnotationClassWithRenamedParametersAsAny(): Any = AnnotationClassWithRenamedParameters(131, "Orange")
|
||||
inline fun getAnnotationClassWithRenamedParametersAsAnyInline(): Any = AnnotationClassWithRenamedParameters(132, "Peach")
|
||||
fun getAnnotationClassWithReorderedParameters(): AnnotationClassWithReorderedParameters = AnnotationClassWithReorderedParameters(133, "Kiwi")
|
||||
inline fun getAnnotationClassWithReorderedParametersInline(): AnnotationClassWithReorderedParameters = AnnotationClassWithReorderedParameters(134, "Watermelon")
|
||||
fun getAnnotationClassWithReorderedParametersAsAny(): Any = AnnotationClassWithReorderedParameters(135, "Grapefruit")
|
||||
inline fun getAnnotationClassWithReorderedParametersAsAnyInline(): Any = AnnotationClassWithReorderedParameters(136, "Melon")
|
||||
fun getAnnotationClassWithNewParameter(): AnnotationClassWithNewParameter = AnnotationClassWithNewParameter(137)
|
||||
inline fun getAnnotationClassWithNewParameterInline(): AnnotationClassWithNewParameter = AnnotationClassWithNewParameter(138)
|
||||
fun getAnnotationClassWithNewParameterAsAny(): Any = AnnotationClassWithNewParameter(139)
|
||||
inline fun getAnnotationClassWithNewParameterAsAnyInline(): Any = AnnotationClassWithNewParameter(140)
|
||||
|
||||
@AnnotationClassWithChangedParameterType(1) class HolderOfAnnotationClassWithChangedParameterType { override fun toString() = "HolderOfAnnotationClassWithChangedParameterType" }
|
||||
@AnnotationClassThatBecomesRegularClass(2) class HolderOfAnnotationClassThatBecomesRegularClass { override fun toString() = "HolderOfAnnotationClassThatBecomesRegularClass" }
|
||||
@AnnotationClassWithParameterThatBecomesRegularClass(AnnotationClassThatBecomesRegularClass(3)) class HolderOfAnnotationClassWithParameterThatBecomesRegularClass { override fun toString() = "HolderOfAnnotationClassWithParameterThatBecomesRegularClass" }
|
||||
@AnnotationClassWithParameterOfParameterThatBecomesRegularClass(AnnotationClassWithParameterThatBecomesRegularClass(AnnotationClassThatBecomesRegularClass(4))) class HolderOfAnnotationClassWithParameterOfParameterThatBecomesRegularClass { override fun toString() = "HolderOfAnnotationClassWithParameterOfParameterThatBecomesRegularClass" }
|
||||
@AnnotationClassThatDisappears(5) class HolderOfAnnotationClassThatDisappears { override fun toString() = "HolderOfAnnotationClassThatDisappears" }
|
||||
@AnnotationClassWithParameterThatDisappears(AnnotationClassThatDisappears(6)) class HolderOfAnnotationClassWithParameterThatDisappears { override fun toString() = "HolderOfAnnotationClassWithParameterThatDisappears" }
|
||||
@AnnotationClassWithParameterOfParameterThatDisappears(AnnotationClassWithParameterThatDisappears(AnnotationClassThatDisappears(7))) class HolderOfAnnotationClassWithParameterOfParameterThatDisappears { override fun toString() = "HolderOfAnnotationClassWithParameterOfParameterThatDisappears" }
|
||||
@AnnotationClassWithRenamedParameters(8, "Grape") class HolderOfAnnotationClassWithRenamedParameters { override fun toString() = "HolderOfAnnotationClassWithRenamedParameters" }
|
||||
@AnnotationClassWithReorderedParameters(9, "Figs") class HolderOfAnnotationClassWithReorderedParameters { override fun toString() = "HolderOfAnnotationClassWithReorderedParameters" }
|
||||
@AnnotationClassWithNewParameter(10) class HolderOfAnnotationClassWithNewParameter { override fun toString() = "HolderOfAnnotationClassWithNewParameter" }
|
||||
|
||||
fun getHolderOfAnnotationClassWithChangedParameterType() = HolderOfAnnotationClassWithChangedParameterType()
|
||||
inline fun getHolderOfAnnotationClassWithChangedParameterTypeInline() = HolderOfAnnotationClassWithChangedParameterType()
|
||||
fun getHolderOfAnnotationClassThatBecomesRegularClass() = HolderOfAnnotationClassThatBecomesRegularClass()
|
||||
inline fun getHolderOfAnnotationClassThatBecomesRegularClassInline() = HolderOfAnnotationClassThatBecomesRegularClass()
|
||||
fun getHolderOfAnnotationClassWithParameterThatBecomesRegularClass() = HolderOfAnnotationClassWithParameterThatBecomesRegularClass()
|
||||
inline fun getHolderOfAnnotationClassWithParameterThatBecomesRegularClassInline() = HolderOfAnnotationClassWithParameterThatBecomesRegularClass()
|
||||
fun getHolderOfAnnotationClassWithParameterOfParameterThatBecomesRegularClass() = HolderOfAnnotationClassWithParameterOfParameterThatBecomesRegularClass()
|
||||
inline fun getHolderOfAnnotationClassWithParameterOfParameterThatBecomesRegularClassInline() = HolderOfAnnotationClassWithParameterOfParameterThatBecomesRegularClass()
|
||||
fun getHolderOfAnnotationClassThatDisappears() = HolderOfAnnotationClassThatDisappears()
|
||||
inline fun getHolderOfAnnotationClassThatDisappearsInline() = HolderOfAnnotationClassThatDisappears()
|
||||
fun getHolderOfAnnotationClassWithParameterThatDisappears() = HolderOfAnnotationClassWithParameterThatDisappears()
|
||||
inline fun getHolderOfAnnotationClassWithParameterThatDisappearsInline() = HolderOfAnnotationClassWithParameterThatDisappears()
|
||||
fun getHolderOfAnnotationClassWithParameterOfParameterThatDisappears() = HolderOfAnnotationClassWithParameterOfParameterThatDisappears()
|
||||
inline fun getHolderOfAnnotationClassWithParameterOfParameterThatDisappearsInline() = HolderOfAnnotationClassWithParameterOfParameterThatDisappears()
|
||||
fun getHolderOfAnnotationClassWithRenamedParameters() = HolderOfAnnotationClassWithRenamedParameters()
|
||||
inline fun getHolderOfAnnotationClassWithRenamedParametersInline() = HolderOfAnnotationClassWithRenamedParameters()
|
||||
fun getHolderOfAnnotationClassWithReorderedParameters() = HolderOfAnnotationClassWithReorderedParameters()
|
||||
inline fun getHolderOfAnnotationClassWithReorderedParametersInline() = HolderOfAnnotationClassWithReorderedParameters()
|
||||
fun getHolderOfAnnotationClassWithNewParameter() = HolderOfAnnotationClassWithNewParameter()
|
||||
inline fun getHolderOfAnnotationClassWithNewParameterInline() = HolderOfAnnotationClassWithNewParameter()
|
||||
|
||||
fun getValueToClass(): ValueToClass = ValueToClass(1)
|
||||
inline fun getValueToClassInline(): ValueToClass = ValueToClass(2)
|
||||
fun getValueToClassAsAny(): Any = ValueToClass(3)
|
||||
inline fun getValueToClassAsAnyInline(): Any = ValueToClass(4)
|
||||
|
||||
fun getClassToValue(): ClassToValue = ClassToValue(1)
|
||||
inline fun getClassToValueInline(): ClassToValue = ClassToValue(2)
|
||||
fun getClassToValueAsAny(): Any = ClassToValue(3)
|
||||
inline fun getClassToValueAsAnyInline(): Any = ClassToValue(4)
|
||||
|
||||
fun getSumFromDataClass(): Int {
|
||||
val (x, y) = DataToClass(1, 2)
|
||||
return x + y
|
||||
}
|
||||
|
||||
fun getFunctionalInterfaceToInterface(): FunctionalInterfaceToInterface {
|
||||
val worker = FunctionalInterfaceToInterface { /* do some work */ }
|
||||
worker.work()
|
||||
return worker
|
||||
}
|
||||
|
||||
fun instantiationOfAbstractClass() {
|
||||
// Accessing uninitialized members of abstract class is an UB. We shall not allow instantiating
|
||||
// abstract classes except for from their direct inheritors.
|
||||
ClassToAbstractClass().getGreeting()
|
||||
}
|
||||
@@ -0,0 +1,210 @@
|
||||
import abitestutils.abiTest
|
||||
import abitestutils.TestMode.NATIVE_CACHE_STATIC_EVERYWHERE
|
||||
|
||||
fun box() = abiTest {
|
||||
/**
|
||||
* `fun foo(): A.B`: In older version of the library `A` and `B` were classes. In newer version `B` is an entry of enum `A`.
|
||||
*
|
||||
* When no lazy IR is used, [IrCall.symbol.owner] is a function (most likely [IrFunctionImpl]) which has the stub [IrClass] (the one
|
||||
* generated by [MissingDeclarationStubGenerator]) with "/A.B|null[0]" signature in the return type. So the function is formally
|
||||
* detected as "referecing an unbound CLASS symbol" and the appropriate error message is constructed.
|
||||
*
|
||||
* When lazy IR is used, [IrCall.symbol.owner] is a lazy-IR function with the return type holding the lazy-IR class
|
||||
* generated from [EnumEntrySyntheticClassDescriptor] for the enum entry and having a different signature: "/A.B.<EEC>|null[0]".
|
||||
* This class is not detected as unbound, and the whole function is not considered as partially linked. But the [IrCall]
|
||||
* still has its own expression type recorded that is deserialized without lazy-IR-distortion, so the [IrCall] expression
|
||||
* is detected as "using an unbound CLASS symbol" with "/A.B|null[0]" signature.
|
||||
*
|
||||
* The [adjustForLazyIr] function is used to adjust tested error messages depending on whether lazy IR is used or not.
|
||||
*/
|
||||
fun adjustForLazyIr(declaration: String) = if (testMode == NATIVE_CACHE_STATIC_EVERYWHERE) "Expression" else declaration
|
||||
|
||||
expectFailure(linkage("Function 'getClassToEnumFoo' can not be called: ${adjustForLazyIr("Function")} uses unlinked class symbol '/ClassToEnum.Foo'")) { getClassToEnumFoo() }
|
||||
expectFailure(linkage("Function 'getClassToEnumFooInline' can not be called: ${adjustForLazyIr("Function")} uses unlinked class symbol '/ClassToEnum.Foo'")) { getClassToEnumFooInline() }
|
||||
expectFailure(linkage("Constructor 'Foo.<init>' can not be called: No constructor found for symbol '/ClassToEnum.Foo.<init>'")) { getClassToEnumFooAsAny() }
|
||||
expectFailure(linkage("Constructor 'Foo.<init>' can not be called: No constructor found for symbol '/ClassToEnum.Foo.<init>'")) { getClassToEnumFooAsAnyInline() }
|
||||
expectFailure(linkage("Function 'getClassToEnumBar' can not be called: ${adjustForLazyIr("Function")} uses unlinked class symbol '/ClassToEnum.Bar'")) { getClassToEnumBar() }
|
||||
expectFailure(linkage("Function 'getClassToEnumBarInline' can not be called: ${adjustForLazyIr("Function")} uses unlinked class symbol '/ClassToEnum.Bar'")) { getClassToEnumBarInline() }
|
||||
expectFailure(linkage("Can not get instance of singleton 'Bar': No class found for symbol '/ClassToEnum.Bar'")) { getClassToEnumBarAsAny() }
|
||||
expectFailure(linkage("Can not get instance of singleton 'Bar': No class found for symbol '/ClassToEnum.Bar'")) { getClassToEnumBarAsAnyInline() }
|
||||
expectFailure(linkage("Function 'getClassToEnumBaz' can not be called: ${adjustForLazyIr("Function")} uses unlinked class symbol '/ClassToEnum.Baz'")) { getClassToEnumBaz() }
|
||||
expectFailure(linkage("Function 'getClassToEnumBazInline' can not be called: ${adjustForLazyIr("Function")} uses unlinked class symbol '/ClassToEnum.Baz'")) { getClassToEnumBazInline() }
|
||||
expectFailure(linkage("Constructor 'ClassToEnum.<init>' can not be called: Private constructor declared in module <lib1> can not be accessed in module <lib2>")) { getClassToEnumBazAsAny() }
|
||||
expectFailure(linkage("Constructor 'ClassToEnum.<init>' can not be called: Private constructor declared in module <lib1> can not be accessed in module <lib2>")) { getClassToEnumBazAsAnyInline() }
|
||||
|
||||
expectFailure(linkage("Function 'getObjectToEnumFoo' can not be called: ${adjustForLazyIr("Function")} uses unlinked class symbol '/ObjectToEnum.Foo'")) { getObjectToEnumFoo() }
|
||||
expectFailure(linkage("Function 'getObjectToEnumFooInline' can not be called: ${adjustForLazyIr("Function")} uses unlinked class symbol '/ObjectToEnum.Foo'")) { getObjectToEnumFooInline() }
|
||||
expectFailure(linkage("Constructor 'Foo.<init>' can not be called: No constructor found for symbol '/ObjectToEnum.Foo.<init>'")) { getObjectToEnumFooAsAny() }
|
||||
expectFailure(linkage("Constructor 'Foo.<init>' can not be called: No constructor found for symbol '/ObjectToEnum.Foo.<init>'")) { getObjectToEnumFooAsAnyInline() }
|
||||
expectFailure(linkage("Function 'getObjectToEnumBar' can not be called: ${adjustForLazyIr("Function")} uses unlinked class symbol '/ObjectToEnum.Bar'")) { getObjectToEnumBar() }
|
||||
expectFailure(linkage("Function 'getObjectToEnumBarInline' can not be called: ${adjustForLazyIr("Function")} uses unlinked class symbol '/ObjectToEnum.Bar'")) { getObjectToEnumBarInline() }
|
||||
expectFailure(linkage("Can not get instance of singleton 'Bar': No class found for symbol '/ObjectToEnum.Bar'")) { getObjectToEnumBarAsAny() }
|
||||
expectFailure(linkage("Can not get instance of singleton 'Bar': No class found for symbol '/ObjectToEnum.Bar'")) { getObjectToEnumBarAsAnyInline() }
|
||||
|
||||
expectFailure(linkage("Can not get instance of singleton 'EnumToClass.Foo': No enum entry found for symbol '/EnumToClass.Foo'")) { getEnumToClassFoo() }
|
||||
expectFailure(linkage("Can not get instance of singleton 'EnumToClass.Foo': No enum entry found for symbol '/EnumToClass.Foo'")) { getEnumToClassFooInline() }
|
||||
expectFailure(linkage("Can not get instance of singleton 'EnumToClass.Foo': No enum entry found for symbol '/EnumToClass.Foo'")) { getEnumToClassFooAsAny() }
|
||||
expectFailure(linkage("Can not get instance of singleton 'EnumToClass.Foo': No enum entry found for symbol '/EnumToClass.Foo'")) { getEnumToClassFooAsAnyInline() }
|
||||
expectFailure(linkage("Can not get instance of singleton 'EnumToClass.Bar': No enum entry found for symbol '/EnumToClass.Bar'")) { getEnumToClassBar() }
|
||||
expectFailure(linkage("Can not get instance of singleton 'EnumToClass.Bar': No enum entry found for symbol '/EnumToClass.Bar'")) { getEnumToClassBarInline() }
|
||||
expectFailure(linkage("Can not get instance of singleton 'EnumToClass.Bar': No enum entry found for symbol '/EnumToClass.Bar'")) { getEnumToClassBarAsAny() }
|
||||
expectFailure(linkage("Can not get instance of singleton 'EnumToClass.Bar': No enum entry found for symbol '/EnumToClass.Bar'")) { getEnumToClassBarAsAnyInline() }
|
||||
expectFailure(linkage("Can not get instance of singleton 'EnumToClass.Baz': No enum entry found for symbol '/EnumToClass.Baz'")) { getEnumToClassBaz() }
|
||||
expectFailure(linkage("Can not get instance of singleton 'EnumToClass.Baz': No enum entry found for symbol '/EnumToClass.Baz'")) { getEnumToClassBazInline() }
|
||||
expectFailure(linkage("Can not get instance of singleton 'EnumToClass.Baz': No enum entry found for symbol '/EnumToClass.Baz'")) { getEnumToClassBazAsAny() }
|
||||
expectFailure(linkage("Can not get instance of singleton 'EnumToClass.Baz': No enum entry found for symbol '/EnumToClass.Baz'")) { getEnumToClassBazAsAnyInline() }
|
||||
|
||||
expectFailure(linkage("Can not get instance of singleton 'EnumToObject.Foo': No enum entry found for symbol '/EnumToObject.Foo'")) { getEnumToObjectFoo() }
|
||||
expectFailure(linkage("Can not get instance of singleton 'EnumToObject.Foo': No enum entry found for symbol '/EnumToObject.Foo'")) { getEnumToObjectFooInline() }
|
||||
expectFailure(linkage("Can not get instance of singleton 'EnumToObject.Foo': No enum entry found for symbol '/EnumToObject.Foo'")) { getEnumToObjectFooAsAny() }
|
||||
expectFailure(linkage("Can not get instance of singleton 'EnumToObject.Foo': No enum entry found for symbol '/EnumToObject.Foo'")) { getEnumToObjectFooAsAnyInline() }
|
||||
expectFailure(linkage("Can not get instance of singleton 'EnumToObject.Bar': No enum entry found for symbol '/EnumToObject.Bar'")) { getEnumToObjectBar() }
|
||||
expectFailure(linkage("Can not get instance of singleton 'EnumToObject.Bar': No enum entry found for symbol '/EnumToObject.Bar'")) { getEnumToObjectBarInline() }
|
||||
expectFailure(linkage("Can not get instance of singleton 'EnumToObject.Bar': No enum entry found for symbol '/EnumToObject.Bar'")) { getEnumToObjectBarAsAny() }
|
||||
expectFailure(linkage("Can not get instance of singleton 'EnumToObject.Bar': No enum entry found for symbol '/EnumToObject.Bar'")) { getEnumToObjectBarAsAnyInline() }
|
||||
|
||||
expectFailure(linkage("Constructor 'ClassToObject.<init>' can not be called: Private constructor declared in module <lib1> can not be accessed in module <lib2>")) { getClassToObject() }
|
||||
expectFailure(linkage("Constructor 'ClassToObject.<init>' can not be called: Private constructor declared in module <lib1> can not be accessed in module <lib2>")) { getClassToObjectInline() }
|
||||
expectFailure(linkage("Constructor 'ClassToObject.<init>' can not be called: Private constructor declared in module <lib1> can not be accessed in module <lib2>")) { getClassToObjectAsAny() }
|
||||
expectFailure(linkage("Constructor 'ClassToObject.<init>' can not be called: Private constructor declared in module <lib1> can not be accessed in module <lib2>")) { getClassToObjectAsAnyInline() }
|
||||
|
||||
expectFailure(linkage("Can not get instance of singleton 'ObjectToClass': 'ObjectToClass' is class while object is expected")) { getObjectToClass() }
|
||||
expectFailure(linkage("Can not get instance of singleton 'ObjectToClass': 'ObjectToClass' is class while object is expected")) { getObjectToClassInline() }
|
||||
expectFailure(linkage("Can not get instance of singleton 'ObjectToClass': 'ObjectToClass' is class while object is expected")) { getObjectToClassAsAny() }
|
||||
expectFailure(linkage("Can not get instance of singleton 'ObjectToClass': 'ObjectToClass' is class while object is expected")) { getObjectToClassAsAnyInline() }
|
||||
|
||||
expectFailure(linkage("Constructor 'ClassToInterface.<init>' can not be called: No constructor found for symbol '/ClassToInterface.<init>'")) { getClassToInterface() }
|
||||
expectFailure(linkage("Constructor 'ClassToInterface.<init>' can not be called: No constructor found for symbol '/ClassToInterface.<init>'")) { getClassToInterfaceInline() }
|
||||
expectFailure(linkage("Constructor 'ClassToInterface.<init>' can not be called: No constructor found for symbol '/ClassToInterface.<init>'")) { getClassToInterfaceAsAny() }
|
||||
expectFailure(linkage("Constructor 'ClassToInterface.<init>' can not be called: No constructor found for symbol '/ClassToInterface.<init>'")) { getClassToInterfaceAsAnyInline() }
|
||||
|
||||
expectSuccess("NestedObjectToCompanion1.Companion") { getNestedObjectToCompanion1().toString() }
|
||||
expectSuccess("NestedObjectToCompanion1.Companion") { getNestedObjectToCompanion1Inline().toString() }
|
||||
expectSuccess("NestedObjectToCompanion1.Companion") { getNestedObjectToCompanion1AsAny().toString() }
|
||||
expectSuccess("NestedObjectToCompanion1.Companion") { getNestedObjectToCompanion1AsAnyInline().toString() }
|
||||
|
||||
expectSuccess("NestedObjectToCompanion2.Foo") { getNestedObjectToCompanion2().toString() }
|
||||
expectSuccess("NestedObjectToCompanion2.Foo") { getNestedObjectToCompanion2Inline().toString() }
|
||||
expectSuccess("NestedObjectToCompanion2.Foo") { getNestedObjectToCompanion2AsAny().toString() }
|
||||
expectSuccess("NestedObjectToCompanion2.Foo") { getNestedObjectToCompanion2AsAnyInline().toString() }
|
||||
|
||||
expectSuccess("CompanionToNestedObject1.Companion") { getCompanionToNestedObject1().toString() }
|
||||
expectSuccess("CompanionToNestedObject1.Companion") { getCompanionToNestedObject1Inline().toString() }
|
||||
expectSuccess("CompanionToNestedObject1.Companion") { getCompanionToNestedObject1AsAny().toString() }
|
||||
expectSuccess("CompanionToNestedObject1.Companion") { getCompanionToNestedObject1AsAnyInline().toString() }
|
||||
expectSuccess("CompanionToNestedObject1.Companion") { getCompanionToNestedObject1Name() }
|
||||
expectSuccess("CompanionToNestedObject1.Companion") { getCompanionToNestedObject1NameShort() }
|
||||
expectSuccess("CompanionToNestedObject1.Companion") { getCompanionToNestedObject1NameInline() }
|
||||
expectSuccess("CompanionToNestedObject1.Companion") { getCompanionToNestedObject1NameShortInline() }
|
||||
|
||||
expectSuccess("CompanionToNestedObject2.Foo") { getCompanionToNestedObject2().toString() }
|
||||
expectSuccess("CompanionToNestedObject2.Foo") { getCompanionToNestedObject2Inline().toString() }
|
||||
expectSuccess("CompanionToNestedObject2.Foo") { getCompanionToNestedObject2AsAny().toString() }
|
||||
expectSuccess("CompanionToNestedObject2.Foo") { getCompanionToNestedObject2AsAnyInline().toString() }
|
||||
expectSuccess("CompanionToNestedObject2.Foo") { getCompanionToNestedObject2Name() }
|
||||
expectSuccess("CompanionToNestedObject2.Foo") { getCompanionToNestedObject2NameShort() }
|
||||
expectSuccess("CompanionToNestedObject2.Foo") { getCompanionToNestedObject2NameInline() }
|
||||
expectSuccess("CompanionToNestedObject2.Foo") { getCompanionToNestedObject2NameShortInline() }
|
||||
|
||||
expectSuccess("Foo") { getCompanionAndNestedObjectsSwap() }
|
||||
expectSuccess("Foo") { getCompanionAndNestedObjectsSwapInline() }
|
||||
|
||||
expectFailure(linkage("Constructor 'NestedToInner.<init>' can not be called: The call site does not provide a dispatch receiver parameter 'this' that the constructor requires")) { getNestedToInnerName() }
|
||||
expectFailure(linkage("Constructor 'NestedToInner.<init>' can not be called: The call site does not provide a dispatch receiver parameter 'this' that the constructor requires")) { getNestedToInnerNameInline() }
|
||||
expectFailure(linkage("Can not get instance of singleton 'Object': 'Object' is inner class while object is expected")) { getNestedToInnerObjectName() }
|
||||
expectFailure(linkage("Can not get instance of singleton 'Object': 'Object' is inner class while object is expected")) { getNestedToInnerObjectNameInline() }
|
||||
expectFailure(linkage("Can not get instance of singleton 'Companion': 'Companion' is inner class while object is expected")) { getNestedToInnerCompanionName() }
|
||||
expectFailure(linkage("Can not get instance of singleton 'Companion': 'Companion' is inner class while object is expected")) { getNestedToInnerCompanionNameInline() }
|
||||
expectFailure(linkage("Constructor 'Nested.<init>' can not be called: The call site does not provide a dispatch receiver parameter 'this' that the constructor requires")) { getNestedToInnerNestedName() }
|
||||
expectFailure(linkage("Constructor 'Nested.<init>' can not be called: The call site does not provide a dispatch receiver parameter 'this' that the constructor requires")) { getNestedToInnerNestedNameInline() }
|
||||
expectFailure(linkage("Constructor 'NestedToInner.<init>' can not be called: The call site does not provide a dispatch receiver parameter 'this' that the constructor requires")) { getNestedToInnerInnerName() }
|
||||
expectFailure(linkage("Constructor 'NestedToInner.<init>' can not be called: The call site does not provide a dispatch receiver parameter 'this' that the constructor requires")) { getNestedToInnerInnerNameInline() }
|
||||
|
||||
expectFailure(linkage("Constructor 'InnerToNested.<init>' can not be called: The call site provides excessive dispatch receiver parameter 'this' that is not needed for the constructor")) { getInnerToNestedName() }
|
||||
expectFailure(linkage("Constructor 'InnerToNested.<init>' can not be called: The call site provides excessive dispatch receiver parameter 'this' that is not needed for the constructor")) { getInnerToNestedNameInline() }
|
||||
expectFailure(linkage("Constructor 'InnerToNested.<init>' can not be called: The call site provides excessive dispatch receiver parameter 'this' that is not needed for the constructor")) { getInnerToNestedObjectName() }
|
||||
expectFailure(linkage("Constructor 'InnerToNested.<init>' can not be called: The call site provides excessive dispatch receiver parameter 'this' that is not needed for the constructor")) { getInnerToNestedObjectNameInline() }
|
||||
expectFailure(linkage("Constructor 'InnerToNested.<init>' can not be called: The call site provides excessive dispatch receiver parameter 'this' that is not needed for the constructor")) { getInnerToNestedCompanionName() }
|
||||
expectFailure(linkage("Constructor 'InnerToNested.<init>' can not be called: The call site provides excessive dispatch receiver parameter 'this' that is not needed for the constructor")) { getInnerToNestedCompanionNameInline() }
|
||||
expectFailure(linkage("Constructor 'InnerToNested.<init>' can not be called: The call site provides excessive dispatch receiver parameter 'this' that is not needed for the constructor")) { getInnerToNestedNestedName() }
|
||||
expectFailure(linkage("Constructor 'InnerToNested.<init>' can not be called: The call site provides excessive dispatch receiver parameter 'this' that is not needed for the constructor")) { getInnerToNestedNestedNameInline() }
|
||||
expectFailure(linkage("Constructor 'InnerToNested.<init>' can not be called: The call site provides excessive dispatch receiver parameter 'this' that is not needed for the constructor")) { getInnerToNestedInnerName() }
|
||||
expectFailure(linkage("Constructor 'InnerToNested.<init>' can not be called: The call site provides excessive dispatch receiver parameter 'this' that is not needed for the constructor")) { getInnerToNestedInnerNameInline() }
|
||||
|
||||
expectFailure(linkage("Constructor 'AnnotationClassWithChangedParameterType.<init>' can not be called: No constructor found for symbol '/AnnotationClassWithChangedParameterType.<init>'")) { getAnnotationClassWithChangedParameterType() }
|
||||
expectFailure(linkage("Constructor 'AnnotationClassWithChangedParameterType.<init>' can not be called: No constructor found for symbol '/AnnotationClassWithChangedParameterType.<init>'")) { getAnnotationClassWithChangedParameterTypeInline() }
|
||||
expectFailure(linkage("Constructor 'AnnotationClassWithChangedParameterType.<init>' can not be called: No constructor found for symbol '/AnnotationClassWithChangedParameterType.<init>'")) { getAnnotationClassWithChangedParameterTypeAsAny() }
|
||||
expectFailure(linkage("Constructor 'AnnotationClassWithChangedParameterType.<init>' can not be called: No constructor found for symbol '/AnnotationClassWithChangedParameterType.<init>'")) { getAnnotationClassWithChangedParameterTypeAsAnyInline() }
|
||||
expectSuccess(105) { getAnnotationClassThatBecomesRegularClass().x }
|
||||
expectSuccess(106) { getAnnotationClassThatBecomesRegularClassInline().x }
|
||||
expectSuccess("AnnotationClassThatBecomesRegularClass[x=107]") { getAnnotationClassThatBecomesRegularClassAsAny().toString() }
|
||||
expectSuccess("AnnotationClassThatBecomesRegularClass[x=108]") { getAnnotationClassThatBecomesRegularClassAsAnyInline().toString() }
|
||||
expectFailure(linkage("Function 'getAnnotationClassWithParameterThatBecomesRegularClass' can not be called: Function uses annotation class 'AnnotationClassWithParameterThatBecomesRegularClass' that has non-annotation class 'AnnotationClassThatBecomesRegularClass' as a parameter")) { getAnnotationClassWithParameterThatBecomesRegularClass().x.x }
|
||||
expectFailure(linkage("Function 'getAnnotationClassWithParameterThatBecomesRegularClassInline' can not be called: Function uses annotation class 'AnnotationClassWithParameterThatBecomesRegularClass' that has non-annotation class 'AnnotationClassThatBecomesRegularClass' as a parameter")) { getAnnotationClassWithParameterThatBecomesRegularClassInline().x.x }
|
||||
expectFailure(linkage("Constructor 'AnnotationClassWithParameterThatBecomesRegularClass.<init>' can not be called: Annotation class 'AnnotationClassWithParameterThatBecomesRegularClass' uses non-annotation class 'AnnotationClassThatBecomesRegularClass' as a parameter")) { getAnnotationClassWithParameterThatBecomesRegularClassAsAny().toString() }
|
||||
expectFailure(linkage("Constructor 'AnnotationClassWithParameterThatBecomesRegularClass.<init>' can not be called: Annotation class 'AnnotationClassWithParameterThatBecomesRegularClass' uses non-annotation class 'AnnotationClassThatBecomesRegularClass' as a parameter")) { getAnnotationClassWithParameterThatBecomesRegularClassAsAnyInline().toString() }
|
||||
expectFailure(linkage("Function 'getAnnotationClassWithParameterOfParameterThatBecomesRegularClass' can not be called: Function uses annotation class 'AnnotationClassWithParameterThatBecomesRegularClass' (via annotation class 'AnnotationClassWithParameterOfParameterThatBecomesRegularClass') that has non-annotation class 'AnnotationClassThatBecomesRegularClass' as a parameter")) { getAnnotationClassWithParameterOfParameterThatBecomesRegularClass().x.x.x }
|
||||
expectFailure(linkage("Function 'getAnnotationClassWithParameterOfParameterThatBecomesRegularClassInline' can not be called: Function uses annotation class 'AnnotationClassWithParameterThatBecomesRegularClass' (via annotation class 'AnnotationClassWithParameterOfParameterThatBecomesRegularClass') that has non-annotation class 'AnnotationClassThatBecomesRegularClass' as a parameter")) { getAnnotationClassWithParameterOfParameterThatBecomesRegularClassInline().x.x.x }
|
||||
expectFailure(linkage("Constructor 'AnnotationClassWithParameterThatBecomesRegularClass.<init>' can not be called: Annotation class 'AnnotationClassWithParameterThatBecomesRegularClass' uses non-annotation class 'AnnotationClassThatBecomesRegularClass' as a parameter")) { getAnnotationClassWithParameterOfParameterThatBecomesRegularClassAsAny().toString() }
|
||||
expectFailure(linkage("Constructor 'AnnotationClassWithParameterThatBecomesRegularClass.<init>' can not be called: Annotation class 'AnnotationClassWithParameterThatBecomesRegularClass' uses non-annotation class 'AnnotationClassThatBecomesRegularClass' as a parameter")) { getAnnotationClassWithParameterOfParameterThatBecomesRegularClassAsAnyInline().toString() }
|
||||
expectFailure(linkage("Function 'getAnnotationClassThatDisappears' can not be called: Function uses unlinked class symbol '/AnnotationClassThatDisappears'")) { getAnnotationClassThatDisappears() }
|
||||
expectFailure(linkage("Function 'getAnnotationClassThatDisappearsInline' can not be called: Function uses unlinked class symbol '/AnnotationClassThatDisappears'")) { getAnnotationClassThatDisappearsInline() }
|
||||
expectFailure(linkage("Constructor 'AnnotationClassThatDisappears.<init>' can not be called: No constructor found for symbol '/AnnotationClassThatDisappears.<init>'")) { getAnnotationClassThatDisappearsAsAny() }
|
||||
expectFailure(linkage("Constructor 'AnnotationClassThatDisappears.<init>' can not be called: No constructor found for symbol '/AnnotationClassThatDisappears.<init>'")) { getAnnotationClassThatDisappearsAsAnyInline() }
|
||||
expectFailure(linkage("Function 'getAnnotationClassWithParameterThatDisappears' can not be called: Function uses unlinked class symbol '/AnnotationClassThatDisappears' (via annotation class 'AnnotationClassWithParameterThatDisappears')")) { getAnnotationClassWithParameterThatDisappears() }
|
||||
expectFailure(linkage("Function 'getAnnotationClassWithParameterThatDisappearsInline' can not be called: Function uses unlinked class symbol '/AnnotationClassThatDisappears' (via annotation class 'AnnotationClassWithParameterThatDisappears')")) { getAnnotationClassWithParameterThatDisappearsInline() }
|
||||
expectFailure(linkage("Function 'getAnnotationClassWithParameterOfParameterThatDisappears' can not be called: Function uses unlinked class symbol '/AnnotationClassThatDisappears' (via annotation class 'AnnotationClassWithParameterOfParameterThatDisappears')")) { getAnnotationClassWithParameterOfParameterThatDisappears() }
|
||||
expectFailure(linkage("Function 'getAnnotationClassWithParameterOfParameterThatDisappearsInline' can not be called: Function uses unlinked class symbol '/AnnotationClassThatDisappears' (via annotation class 'AnnotationClassWithParameterOfParameterThatDisappears')")) { getAnnotationClassWithParameterOfParameterThatDisappearsInline() }
|
||||
expectFailure(linkage("Constructor 'AnnotationClassThatDisappears.<init>' can not be called: No constructor found for symbol '/AnnotationClassThatDisappears.<init>'")) { getAnnotationClassWithParameterThatDisappearsAsAny() }
|
||||
expectFailure(linkage("Constructor 'AnnotationClassThatDisappears.<init>' can not be called: No constructor found for symbol '/AnnotationClassThatDisappears.<init>'")) { getAnnotationClassWithParameterThatDisappearsAsAnyInline() }
|
||||
expectSuccess("@AnnotationClassWithRenamedParameters(xi=129, xs=Banana)") { getAnnotationClassWithRenamedParameters().toString() }
|
||||
expectSuccess("@AnnotationClassWithRenamedParameters(xi=130, xs=Pear)") { getAnnotationClassWithRenamedParametersInline().toString() }
|
||||
expectSuccess("@AnnotationClassWithRenamedParameters(xi=131, xs=Orange)") { getAnnotationClassWithRenamedParametersAsAny().toString() }
|
||||
expectSuccess("@AnnotationClassWithRenamedParameters(xi=132, xs=Peach)") { getAnnotationClassWithRenamedParametersAsAnyInline().toString() }
|
||||
expectFailure(linkage("Constructor 'AnnotationClassWithReorderedParameters.<init>' can not be called: No constructor found for symbol '/AnnotationClassWithReorderedParameters.<init>'")) { getAnnotationClassWithReorderedParameters() }
|
||||
expectFailure(linkage("Constructor 'AnnotationClassWithReorderedParameters.<init>' can not be called: No constructor found for symbol '/AnnotationClassWithReorderedParameters.<init>'")) { getAnnotationClassWithReorderedParametersInline() }
|
||||
expectFailure(linkage("Constructor 'AnnotationClassWithReorderedParameters.<init>' can not be called: No constructor found for symbol '/AnnotationClassWithReorderedParameters.<init>'")) { getAnnotationClassWithReorderedParametersAsAny() }
|
||||
expectFailure(linkage("Constructor 'AnnotationClassWithReorderedParameters.<init>' can not be called: No constructor found for symbol '/AnnotationClassWithReorderedParameters.<init>'")) { getAnnotationClassWithReorderedParametersAsAnyInline() }
|
||||
expectFailure(linkage("Constructor 'AnnotationClassWithNewParameter.<init>' can not be called: No constructor found for symbol '/AnnotationClassWithNewParameter.<init>'")) { getAnnotationClassWithNewParameter() }
|
||||
expectFailure(linkage("Constructor 'AnnotationClassWithNewParameter.<init>' can not be called: No constructor found for symbol '/AnnotationClassWithNewParameter.<init>'")) { getAnnotationClassWithNewParameterInline() }
|
||||
expectFailure(linkage("Constructor 'AnnotationClassWithNewParameter.<init>' can not be called: No constructor found for symbol '/AnnotationClassWithNewParameter.<init>'")) { getAnnotationClassWithNewParameterAsAny() }
|
||||
expectFailure(linkage("Constructor 'AnnotationClassWithNewParameter.<init>' can not be called: No constructor found for symbol '/AnnotationClassWithNewParameter.<init>'")) { getAnnotationClassWithNewParameterAsAnyInline() }
|
||||
|
||||
// Handle unlinked constructor call in annotation & non-annotation class appearing in annotation:
|
||||
expectSuccess("HolderOfAnnotationClassWithChangedParameterType") { getHolderOfAnnotationClassWithChangedParameterType().toString() }
|
||||
expectSuccess("HolderOfAnnotationClassWithChangedParameterType") { getHolderOfAnnotationClassWithChangedParameterTypeInline().toString() }
|
||||
expectSuccess("HolderOfAnnotationClassThatBecomesRegularClass") { getHolderOfAnnotationClassThatBecomesRegularClass().toString() }
|
||||
expectSuccess("HolderOfAnnotationClassThatBecomesRegularClass") { getHolderOfAnnotationClassThatBecomesRegularClassInline().toString() }
|
||||
expectSuccess("HolderOfAnnotationClassWithParameterThatBecomesRegularClass") { getHolderOfAnnotationClassWithParameterThatBecomesRegularClass().toString() }
|
||||
expectSuccess("HolderOfAnnotationClassWithParameterThatBecomesRegularClass") { getHolderOfAnnotationClassWithParameterThatBecomesRegularClassInline().toString() }
|
||||
expectSuccess("HolderOfAnnotationClassWithParameterOfParameterThatBecomesRegularClass") { getHolderOfAnnotationClassWithParameterOfParameterThatBecomesRegularClass().toString() }
|
||||
expectSuccess("HolderOfAnnotationClassWithParameterOfParameterThatBecomesRegularClass") { getHolderOfAnnotationClassWithParameterOfParameterThatBecomesRegularClassInline().toString() }
|
||||
expectSuccess("HolderOfAnnotationClassThatDisappears") { getHolderOfAnnotationClassThatDisappears().toString() }
|
||||
expectSuccess("HolderOfAnnotationClassThatDisappears") { getHolderOfAnnotationClassThatDisappearsInline().toString() }
|
||||
expectSuccess("HolderOfAnnotationClassWithParameterThatDisappears") { getHolderOfAnnotationClassWithParameterThatDisappears().toString() }
|
||||
expectSuccess("HolderOfAnnotationClassWithParameterThatDisappears") { getHolderOfAnnotationClassWithParameterThatDisappearsInline().toString() }
|
||||
expectSuccess("HolderOfAnnotationClassWithParameterOfParameterThatDisappears") { getHolderOfAnnotationClassWithParameterOfParameterThatDisappears().toString() }
|
||||
expectSuccess("HolderOfAnnotationClassWithParameterOfParameterThatDisappears") { getHolderOfAnnotationClassWithParameterOfParameterThatDisappearsInline().toString() }
|
||||
expectSuccess("HolderOfAnnotationClassWithRenamedParameters") { getHolderOfAnnotationClassWithRenamedParameters().toString() }
|
||||
expectSuccess("HolderOfAnnotationClassWithRenamedParameters") { getHolderOfAnnotationClassWithRenamedParametersInline().toString() }
|
||||
expectSuccess("HolderOfAnnotationClassWithReorderedParameters") { getHolderOfAnnotationClassWithReorderedParameters().toString() }
|
||||
expectSuccess("HolderOfAnnotationClassWithReorderedParameters") { getHolderOfAnnotationClassWithReorderedParametersInline().toString() }
|
||||
expectSuccess("HolderOfAnnotationClassWithNewParameter") { getHolderOfAnnotationClassWithNewParameter().toString() }
|
||||
expectSuccess("HolderOfAnnotationClassWithNewParameter") { getHolderOfAnnotationClassWithNewParameterInline().toString() }
|
||||
|
||||
expectSuccess { getValueToClass(); "OK" }
|
||||
expectSuccess { getValueToClassInline(); "OK" }
|
||||
expectSuccess { getValueToClassAsAny(); "OK" }
|
||||
expectSuccess { getValueToClassAsAnyInline(); "OK" }
|
||||
|
||||
expectSuccess { getClassToValue(); "OK" }
|
||||
expectSuccess { getClassToValueInline(); "OK" }
|
||||
expectSuccess { getClassToValueAsAny(); "OK" }
|
||||
expectSuccess { getClassToValueAsAnyInline(); "OK" }
|
||||
|
||||
expectFailure(linkage("Function 'component1' can not be called: No function found for symbol '/DataToClass.component1'")) { getSumFromDataClass() }
|
||||
|
||||
expectSuccess { getFunctionalInterfaceToInterface(); "OK" }
|
||||
|
||||
expectFailure(linkage("Constructor 'ClassToAbstractClass.<init>' can not be called: Can not instantiate abstract class 'ClassToAbstractClass'")) { instantiationOfAbstractClass() }
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
@file:Suppress("RedundantSuspendModifier", "NOTHING_TO_INLINE")
|
||||
|
||||
class Cache {
|
||||
private val cache = mutableMapOf<String, String>()
|
||||
fun load(key: String): String? = cache[key]
|
||||
fun store(key: String, value: String) { cache[key] = value }
|
||||
fun dumpToString(): String = cache.entries.sortedBy { it.key }.joinToString(",") { it.key + "=" + it.value }
|
||||
}
|
||||
|
||||
class OperatorsToNonOperators(private val cache: Cache) {
|
||||
operator fun get(key: String): String? = cache.load(key)
|
||||
operator fun set(key: String, value: String) = cache.store(key, value)
|
||||
operator fun invoke(): String = cache.dumpToString()
|
||||
|
||||
companion object {
|
||||
operator fun Cache.get(key: String): String? = load(key)
|
||||
operator fun Cache.set(key: String, value: String) = store(key, value)
|
||||
operator fun Cache.invoke(): String = dumpToString()
|
||||
}
|
||||
}
|
||||
|
||||
class NonOperatorsToOperators(private val cache: Cache) {
|
||||
fun get(key: String): String? = cache.load(key)
|
||||
fun set(key: String, value: String) = cache.store(key, value)
|
||||
fun invoke(): String = cache.dumpToString()
|
||||
|
||||
companion object {
|
||||
fun Cache.get(key: String): String? = load(key)
|
||||
fun Cache.set(key: String, value: String) = store(key, value)
|
||||
fun Cache.invoke(): String = dumpToString()
|
||||
}
|
||||
}
|
||||
|
||||
data class Wrapper(private val value: Int) {
|
||||
private operator fun plus(other: Wrapper): Wrapper = (value + other.value).wrap()
|
||||
fun unwrap(): Int = value
|
||||
|
||||
fun memberNonInfixToInfix(other: Wrapper): Wrapper = this + other
|
||||
infix fun memberInfixToNonInfix(other: Wrapper): Wrapper = this + other
|
||||
|
||||
companion object {
|
||||
fun Wrapper.extensionNonInfixToInfix(other: Wrapper): Wrapper = this + other
|
||||
infix fun Wrapper.extensionInfixToNonInfix(other: Wrapper): Wrapper = this + other
|
||||
}
|
||||
}
|
||||
|
||||
fun Int.wrap(): Wrapper = Wrapper(this)
|
||||
|
||||
object Functions {
|
||||
fun nonTailrecToTailrec(n: Int, r: Int): Int = if (n <= 1) r else nonTailrecToTailrec(n - 1, n * r)
|
||||
tailrec fun tailrecToNonTailrec(n: Int, r: Int): Int = if (n <= 1) r else tailrecToNonTailrec(n - 1, n * r)
|
||||
|
||||
@Suppress("RedundantSuspendModifier") suspend fun <R> wrapCoroutine(coroutine: suspend () -> R): R = coroutine.invoke()
|
||||
suspend fun suspendToNonSuspendFunction(x: Int): Int = wrapCoroutine { -x }
|
||||
fun nonSuspendToSuspendFunction(x: Int): Int = -x
|
||||
|
||||
inline fun inlineLambdaToNoinlineLambda(x: Int, lambda: (Int) -> String): String = "Functions.inlineLambdaToNoinlineLambda($x) { ${lambda(x * 2)} }"
|
||||
inline fun inlineLambdaToCrossinlineLambda(x: Int, lambda: (Int) -> String): String = "Functions.inlineLambdaToCrossinlineLambda($x) { ${lambda(x * 2)} }"
|
||||
|
||||
fun removedFirstDefaultValue(a: Int = 42, b: Int): Int = a + b
|
||||
fun removedVarargFirstDefaultValue(vararg a: Int = intArrayOf(1, 2, 3), b: Int): Int = a.sum() + b
|
||||
fun removedLastDefaultValue(a: Int, b: Int = 42): Int = a + b
|
||||
fun removedVarargLastDefaultValue(a: Int, vararg b: Int = intArrayOf(1, 2, 3)): Int = a + b.sum()
|
||||
}
|
||||
|
||||
class RemovedFirstDefaultValueInConstructor(a: Int = 42, b: Int) {
|
||||
val value = a + b
|
||||
}
|
||||
class RemovedLastDefaultValueInConstructor(a: Int, b: Int = 42) {
|
||||
val value = a + b
|
||||
}
|
||||
|
||||
interface Interface {
|
||||
suspend fun suspendToNonSuspendFunction(x: Int): String
|
||||
fun nonSuspendToSuspendFunction(x: Int): String
|
||||
}
|
||||
|
||||
abstract class AbstractClass {
|
||||
abstract suspend fun suspendToNonSuspendFunction(x: Int): String
|
||||
abstract fun nonSuspendToSuspendFunction(x: Int): String
|
||||
}
|
||||
|
||||
open class OpenClass {
|
||||
open suspend fun suspendToNonSuspendFunction(x: Int): String = Functions.wrapCoroutine { "OpenClass.suspendToNonSuspendFunction($x)" }
|
||||
open fun nonSuspendToSuspendFunction(x: Int): String = "OpenClass.nonSuspendToSuspendFunction($x)"
|
||||
|
||||
open suspend fun suspendToNonSuspendFunctionWithDelegation(x: Int): String = Functions.wrapCoroutine { "OpenClass.suspendToNonSuspendFunctionWithDelegation($x)" }
|
||||
open fun nonSuspendToSuspendFunctionWithDelegation(x: Int): String = "OpenClass.nonSuspendToSuspendFunctionWithDelegation($x)"
|
||||
|
||||
open fun openNonInlineToInlineFunction(x: Int): String = "OpenClass.openNonInlineToInlineFunction($x)"
|
||||
open fun openNonInlineToInlineFunctionWithDelegation(x: Int): String = "OpenClass.openNonInlineToInlineFunctionWithDelegation($x)"
|
||||
//inline fun newInlineFunction1(x: Int): String = "OpenClass.newInlineFunction1($x)"
|
||||
//inline fun newInlineFunction2(x: Int): String = "OpenClass.newInlineFunction2($x)"
|
||||
//fun newNonInlineFunction(x: Int): String = "OpenClass.newNonInlineFunction($x)"
|
||||
|
||||
fun newInlineFunction1Caller(x: Int): String = TODO("Not implemented: OpenClass.newInlineFunction1Caller($x)")
|
||||
fun newInlineFunction2Caller(x: Int): String = TODO("Not implemented: OpenClass.newInlineFunction2Caller($x)")
|
||||
fun newNonInlineFunctionCaller(x: Int): String = TODO("Not implemented: OpenClass.newNonInlineFunctionCaller($x)")
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
@file:Suppress("RedundantSuspendModifier", "NOTHING_TO_INLINE")
|
||||
|
||||
class Cache {
|
||||
private val cache = mutableMapOf<String, String>()
|
||||
fun load(key: String): String? = cache[key]
|
||||
fun store(key: String, value: String) { cache[key] = value }
|
||||
fun dumpToString(): String = cache.entries.sortedBy { it.key }.joinToString(",") { it.key + "=" + it.value }
|
||||
}
|
||||
|
||||
class OperatorsToNonOperators(private val cache: Cache) {
|
||||
fun get(key: String): String? = cache.load(key)
|
||||
fun set(key: String, value: String) = cache.store(key, value)
|
||||
fun invoke(): String = cache.dumpToString()
|
||||
|
||||
companion object {
|
||||
fun Cache.get(key: String): String? = load(key)
|
||||
fun Cache.set(key: String, value: String) = store(key, value)
|
||||
fun Cache.invoke(): String = dumpToString()
|
||||
}
|
||||
}
|
||||
|
||||
class NonOperatorsToOperators(private val cache: Cache) {
|
||||
operator fun get(key: String): String? = cache.load(key)
|
||||
operator fun set(key: String, value: String) = cache.store(key, value)
|
||||
operator fun invoke(): String = cache.dumpToString()
|
||||
|
||||
companion object {
|
||||
operator fun Cache.get(key: String): String? = load(key)
|
||||
operator fun Cache.set(key: String, value: String) = store(key, value)
|
||||
operator fun Cache.invoke(): String = dumpToString()
|
||||
}
|
||||
}
|
||||
|
||||
data class Wrapper(private val value: Int) {
|
||||
private operator fun plus(other: Wrapper): Wrapper = (value + other.value).wrap()
|
||||
fun unwrap(): Int = value
|
||||
|
||||
infix fun memberNonInfixToInfix(other: Wrapper): Wrapper = this + other
|
||||
fun memberInfixToNonInfix(other: Wrapper): Wrapper = this + other
|
||||
|
||||
companion object {
|
||||
infix fun Wrapper.extensionNonInfixToInfix(other: Wrapper): Wrapper = this + other
|
||||
fun Wrapper.extensionInfixToNonInfix(other: Wrapper): Wrapper = this + other
|
||||
}
|
||||
}
|
||||
|
||||
fun Int.wrap(): Wrapper = Wrapper(this)
|
||||
|
||||
object Functions {
|
||||
tailrec fun nonTailrecToTailrec(n: Int, r: Int): Int = if (n <= 1) r else nonTailrecToTailrec(n - 1, n * r)
|
||||
fun tailrecToNonTailrec(n: Int, r: Int): Int = if (n <= 1) r else tailrecToNonTailrec(n - 1, n * r)
|
||||
|
||||
@Suppress("RedundantSuspendModifier") suspend fun <R> wrapCoroutine(coroutine: suspend () -> R): R = coroutine.invoke()
|
||||
fun suspendToNonSuspendFunction(x: Int): Int = -x
|
||||
suspend fun nonSuspendToSuspendFunction(x: Int): Int = wrapCoroutine { -x }
|
||||
|
||||
inline fun inlineLambdaToNoinlineLambda(x: Int, noinline lambda: (Int) -> String): String = "Functions.inlineLambdaToNoinlineLambda($x) { ${lambda(x * 2)} }"
|
||||
inline fun inlineLambdaToCrossinlineLambda(x: Int, crossinline lambda: (Int) -> String): String = "Functions.inlineLambdaToCrossinlineLambda($x) { ${lambda(x * 2)} }"
|
||||
|
||||
fun removedFirstDefaultValue(a: Int /*= 42*/, b: Int): Int = a + b
|
||||
fun removedVarargFirstDefaultValue(vararg a: Int /*= intArrayOf(1, 2, 3)*/, b: Int): Int = a.sum() + b
|
||||
fun removedLastDefaultValue(a: Int, b: Int /*= 42*/): Int = a + b
|
||||
fun removedVarargLastDefaultValue(a: Int, vararg b: Int /*= intArrayOf(1, 2, 3)*/): Int = a + b.sum()
|
||||
}
|
||||
|
||||
class RemovedFirstDefaultValueInConstructor(a: Int /*= 42*/, b: Int) {
|
||||
val value = a + b
|
||||
}
|
||||
class RemovedLastDefaultValueInConstructor(a: Int, b: Int /*= 42*/) {
|
||||
val value = a + b
|
||||
}
|
||||
|
||||
interface Interface {
|
||||
fun suspendToNonSuspendFunction(x: Int): String
|
||||
suspend fun nonSuspendToSuspendFunction(x: Int): String
|
||||
}
|
||||
|
||||
abstract class AbstractClass {
|
||||
abstract fun suspendToNonSuspendFunction(x: Int): String
|
||||
abstract suspend fun nonSuspendToSuspendFunction(x: Int): String
|
||||
}
|
||||
|
||||
open class OpenClass {
|
||||
open fun suspendToNonSuspendFunction(x: Int): String = "OpenClassV2.suspendToNonSuspendFunction($x)"
|
||||
open suspend fun nonSuspendToSuspendFunction(x: Int): String = Functions.wrapCoroutine { "OpenClassV2.nonSuspendToSuspendFunction($x)" }
|
||||
|
||||
open fun suspendToNonSuspendFunctionWithDelegation(x: Int): String = "OpenClassV2.suspendToNonSuspendFunctionWithDelegation($x)"
|
||||
open suspend fun nonSuspendToSuspendFunctionWithDelegation(x: Int): String = Functions.wrapCoroutine { "OpenClassV2.nonSuspendToSuspendFunctionWithDelegation($x)" }
|
||||
|
||||
inline fun openNonInlineToInlineFunction(x: Int): String = "OpenClassV2.openNonInlineToInlineFunction($x)"
|
||||
inline fun openNonInlineToInlineFunctionWithDelegation(x: Int): String = "OpenClassV2.openNonInlineToInlineFunctionWithDelegation($x)"
|
||||
inline fun newInlineFunction1(x: Int): String = "OpenClassV2.newInlineFunction1($x)"
|
||||
inline fun newInlineFunction2(x: Int): String = "OpenClassV2.newInlineFunction2($x)"
|
||||
fun newNonInlineFunction(x: Int): String = "OpenClassV2.newNonInlineFunction($x)"
|
||||
|
||||
fun newInlineFunction1Caller(x: Int): String = newInlineFunction1(x)
|
||||
fun newInlineFunction2Caller(x: Int): String = newInlineFunction2(x)
|
||||
fun newNonInlineFunctionCaller(x: Int): String = newNonInlineFunction(x)
|
||||
}
|
||||
@@ -0,0 +1,163 @@
|
||||
import kotlin.coroutines.*
|
||||
|
||||
// Auxiliary function to imitate coroutines.
|
||||
private fun <R> runCoroutine(coroutine: suspend () -> R): R {
|
||||
var coroutineResult: Result<R>? = null
|
||||
|
||||
coroutine.startCoroutine(Continuation(EmptyCoroutineContext) { result ->
|
||||
coroutineResult = result
|
||||
})
|
||||
|
||||
return (coroutineResult ?: error("Coroutine finished without any result")).getOrThrow()
|
||||
}
|
||||
|
||||
private inline fun <R> runInlined(block: () -> R): R = block() // a-la kotlin.run() but without contracts and special annotation
|
||||
|
||||
fun memberOperatorsToNonOperators(vararg pairs: Pair<String, String>): String {
|
||||
check(pairs.isNotEmpty())
|
||||
val instance = OperatorsToNonOperators(Cache())
|
||||
pairs.forEach { (key, value) ->
|
||||
instance[key] = value // set
|
||||
}
|
||||
pairs.forEach { (key, value) ->
|
||||
check(instance[key] == value) // get
|
||||
}
|
||||
return "memberOperatorsToNonOperators: " + instance() // invoke
|
||||
}
|
||||
|
||||
fun extensionOperatorsToNonOperators(vararg pairs: Pair<String, String>): String = with(OperatorsToNonOperators.Companion) {
|
||||
check(pairs.isNotEmpty())
|
||||
val cache = Cache()
|
||||
pairs.forEach { (key, value) ->
|
||||
cache[key] = value // set
|
||||
}
|
||||
pairs.forEach { (key, value) ->
|
||||
check(cache[key] == value) // get
|
||||
}
|
||||
return "extensionOperatorsToNonOperators: " + cache() // invoke
|
||||
}
|
||||
|
||||
fun memberNonOperatorsToOperators(vararg pairs: Pair<String, String>): String {
|
||||
check(pairs.isNotEmpty())
|
||||
val instance = NonOperatorsToOperators(Cache())
|
||||
pairs.forEach { (key, value) ->
|
||||
instance.set(key, value) // set
|
||||
}
|
||||
pairs.forEach { (key, value) ->
|
||||
check(instance.get(key) == value) // get
|
||||
}
|
||||
return "memberNonOperatorsToOperators: " + instance.invoke() // invoke
|
||||
}
|
||||
|
||||
fun extensionNonOperatorsToOperators(vararg pairs: Pair<String, String>): String = with(NonOperatorsToOperators.Companion) {
|
||||
check(pairs.isNotEmpty())
|
||||
val cache = Cache()
|
||||
pairs.forEach { (key, value) ->
|
||||
cache.set(key, value) // set
|
||||
}
|
||||
pairs.forEach { (key, value) ->
|
||||
check(cache.get(key) == value) // get
|
||||
}
|
||||
return "extensionNonOperatorsToOperators: " + cache.invoke() // invoke
|
||||
}
|
||||
|
||||
fun memberNonInfixToInfix(a: Int, b: Int): Int = a.wrap().memberNonInfixToInfix(b.wrap()).unwrap()
|
||||
fun extensionNonInfixToInfix(a: Int, b: Int): Int = with(Wrapper.Companion) { a.wrap().extensionNonInfixToInfix(b.wrap()).unwrap() }
|
||||
fun memberInfixToNonInfix(a: Int, b: Int): Int = (a.wrap() memberInfixToNonInfix b.wrap()).unwrap()
|
||||
fun extensionInfixToNonInfix(a: Int, b: Int): Int = with(Wrapper.Companion) { (a.wrap() extensionInfixToNonInfix b.wrap()).unwrap() }
|
||||
|
||||
fun nonTailrecToTailrec(n: Int): Int = Functions.nonTailrecToTailrec(n, 1)
|
||||
tailrec fun tailrecToNonTailrec(n: Int): Int = Functions.tailrecToNonTailrec(n, 1)
|
||||
|
||||
// This is required to check that default arguments are counter correctly even for inherited classes.
|
||||
open class StableOpenClass {
|
||||
open fun firstDefaultValueInFunction(a: Int = 42, b: Int): Int = a + b
|
||||
open fun lastDefaultValueInFunction(a: Int, b: Int = 42): Int = a + b
|
||||
}
|
||||
open class StableClassImpl : StableOpenClass()
|
||||
class StableClassImpl2 : StableClassImpl() {
|
||||
override fun firstDefaultValueInFunction(a: Int, b: Int): Int = a - b
|
||||
override fun lastDefaultValueInFunction(a: Int, b: Int): Int = a - b
|
||||
}
|
||||
|
||||
fun firstDefaultValueInFunctionInStableOpenClass(stableOpenClass: StableOpenClass, n: Int): Int = stableOpenClass.firstDefaultValueInFunction(b = n)
|
||||
fun lastDefaultValueInFunctionInStableOpenClass(stableOpenClass: StableOpenClass, n: Int): Int = stableOpenClass.lastDefaultValueInFunction(a = n)
|
||||
fun firstDefaultValueInFunctionInStableClassImpl(stableClassImpl: StableClassImpl, n: Int): Int = stableClassImpl.firstDefaultValueInFunction(b = n)
|
||||
fun lastDefaultValueInFunctionInStableClassImpl(stableClassImpl: StableClassImpl, n: Int): Int = stableClassImpl.lastDefaultValueInFunction(a = n)
|
||||
fun firstDefaultValueInFunctionInStableClassImpl2(stableClassImpl2: StableClassImpl2, n: Int): Int = stableClassImpl2.firstDefaultValueInFunction(b = n)
|
||||
fun lastDefaultValueInFunctionInStableClassImpl2(stableClassImpl2: StableClassImpl2, n: Int): Int = stableClassImpl2.lastDefaultValueInFunction(a = n)
|
||||
|
||||
fun removedFirstDefaultValueInFunction(n: Int): Int = Functions.removedFirstDefaultValue(b = n)
|
||||
fun removedVarargFirstDefaultValueInFunction(n: Int): Int = Functions.removedVarargFirstDefaultValue(b = n)
|
||||
fun removedLastDefaultValueInFunction(n: Int): Int = Functions.removedLastDefaultValue(a = n)
|
||||
fun removedVarargLastDefaultValueInFunction(n: Int): Int = Functions.removedVarargLastDefaultValue(a = n)
|
||||
fun removedFirstDefaultValueInConstructor(n: Int): Int = RemovedFirstDefaultValueInConstructor(b = n).value
|
||||
fun removedLastDefaultValueInConstructor(n: Int): Int = RemovedLastDefaultValueInConstructor(a = n).value
|
||||
|
||||
fun singleVarargArgument(vararg elements: Int): Int = elements.sum()
|
||||
fun singleVarargArgumentWithDefaultValue(vararg elements: Int = intArrayOf(-1, -2, -3)): Int = elements.sum()
|
||||
fun varargArgumentAndOtherArguments(first: Int, vararg elements: Int, last: Int): Int = first + elements.sum() + last
|
||||
fun varargArgumentAndOtherArgumentsWithDefaultValues(first: Int = -100, vararg elements: Int, last: Int = -10): Int = first + elements.sum() + last
|
||||
fun varargArgumentWithDefaultValueAndOtherArguments(first: Int, vararg elements: Int = intArrayOf(-1, -2, -3), last: Int): Int = first + elements.sum() + last
|
||||
fun varargArgumentWithDefaultValueAndOtherArgumentsWithDefaultValues(first: Int = -100, vararg elements: Int = intArrayOf(-1, -2, -3), last: Int = -10): Int = first + elements.sum() + last
|
||||
|
||||
fun suspendToNonSuspendFunction1(x: Int): Int = runCoroutine { Functions.suspendToNonSuspendFunction(x) }
|
||||
fun suspendToNonSuspendFunction2(x: Int): Int = runCoroutine { Functions.wrapCoroutine { Functions.suspendToNonSuspendFunction(x) } }
|
||||
fun suspendToNonSuspendFunction3(x: Int): Int = runCoroutine { runInlined { Functions.suspendToNonSuspendFunction(x) } }
|
||||
fun nonSuspendToSuspendFunction1(x: Int): Int = Functions.nonSuspendToSuspendFunction(x)
|
||||
fun nonSuspendToSuspendFunction2(x: Int): Int = runCoroutine { Functions.nonSuspendToSuspendFunction(x) }
|
||||
fun nonSuspendToSuspendFunction3(x: Int): Int = runInlined { Functions.nonSuspendToSuspendFunction(x) }
|
||||
fun nonSuspendToSuspendFunction4(x: Int): Int = runCoroutine { runInlined { Functions.nonSuspendToSuspendFunction(x) } }
|
||||
|
||||
class InterfaceImpl : Interface {
|
||||
override suspend fun suspendToNonSuspendFunction(x: Int): String = Functions.wrapCoroutine { "InterfaceImpl.suspendToNonSuspendFunction($x)" }
|
||||
override fun nonSuspendToSuspendFunction(x: Int): String = "InterfaceImpl.nonSuspendToSuspendFunction($x)"
|
||||
}
|
||||
|
||||
class AbstractClassImpl : AbstractClass() {
|
||||
override suspend fun suspendToNonSuspendFunction(x: Int): String = Functions.wrapCoroutine { "AbstractClassImpl.suspendToNonSuspendFunction($x)" }
|
||||
override fun nonSuspendToSuspendFunction(x: Int): String = "AbstractClassImpl.nonSuspendToSuspendFunction($x)"
|
||||
}
|
||||
|
||||
class OpenClassImpl : OpenClass() {
|
||||
override suspend fun suspendToNonSuspendFunction(x: Int): String = Functions.wrapCoroutine { "OpenClassImpl.suspendToNonSuspendFunction($x)" }
|
||||
override fun nonSuspendToSuspendFunction(x: Int): String = "OpenClassImpl.nonSuspendToSuspendFunction($x)"
|
||||
|
||||
override suspend fun suspendToNonSuspendFunctionWithDelegation(x: Int): String = super.suspendToNonSuspendFunctionWithDelegation(x) + " called from OpenClassImpl.suspendToNonSuspendFunctionWithDelegation($x)"
|
||||
override fun nonSuspendToSuspendFunctionWithDelegation(x: Int): String = super.nonSuspendToSuspendFunctionWithDelegation(x) + " called from OpenClassImpl.nonSuspendToSuspendFunctionWithDelegation($x)"
|
||||
|
||||
override fun openNonInlineToInlineFunction(x: Int): String = "OpenClassImpl.openNonInlineToInlineFunction($x)"
|
||||
override fun openNonInlineToInlineFunctionWithDelegation(x: Int): String = super.openNonInlineToInlineFunctionWithDelegation(x) + " called from OpenClassImpl.openNonInlineToInlineFunctionWithDelegation($x)"
|
||||
fun newInlineFunction1(x: Int): String = "OpenClassImpl.newInlineFunction1($x)" // overrides accidentally appeared inline function
|
||||
inline fun newInlineFunction2(x: Int): String = "OpenClassImpl.newInlineFunction2($x)" // overrides accidentally appeared inline function
|
||||
inline fun newNonInlineFunction(x: Int): String = "OpenClassImpl.newNonInlineFunction($x)" // overrides accidentally appeared non-inline function
|
||||
}
|
||||
|
||||
fun suspendToNonSuspendFunctionInInterface(i: Interface, x: Int): String = runCoroutine { i.suspendToNonSuspendFunction(x) }
|
||||
fun nonSuspendToSuspendFunctionInInterface(i: Interface, x: Int): String = i.nonSuspendToSuspendFunction(x)
|
||||
fun suspendToNonSuspendFunctionInInterfaceImpl(ii: InterfaceImpl, x: Int): String = runCoroutine { ii.suspendToNonSuspendFunction(x) }
|
||||
fun nonSuspendToSuspendFunctionInInterfaceImpl(ii: InterfaceImpl, x: Int): String = ii.nonSuspendToSuspendFunction(x)
|
||||
fun suspendToNonSuspendFunctionInAbstractClass(ac: AbstractClass, x: Int): String = runCoroutine { ac.suspendToNonSuspendFunction(x) }
|
||||
fun nonSuspendToSuspendFunctionInAbstractClass(ac: AbstractClass, x: Int): String = ac.nonSuspendToSuspendFunction(x)
|
||||
fun suspendToNonSuspendFunctionInAbstractClassImpl(aci: AbstractClassImpl, x: Int): String = runCoroutine { aci.suspendToNonSuspendFunction(x) }
|
||||
fun nonSuspendToSuspendFunctionInAbstractClassImpl(aci: AbstractClassImpl, x: Int): String = aci.nonSuspendToSuspendFunction(x)
|
||||
fun suspendToNonSuspendFunctionInOpenClass(oc: OpenClass, x: Int): String = runCoroutine { oc.suspendToNonSuspendFunction(x) }
|
||||
fun nonSuspendToSuspendFunctionInOpenClass(oc: OpenClass, x: Int): String = oc.nonSuspendToSuspendFunction(x)
|
||||
fun suspendToNonSuspendFunctionInOpenClassImpl(oci: OpenClassImpl, x: Int): String = runCoroutine { oci.suspendToNonSuspendFunction(x) }
|
||||
fun nonSuspendToSuspendFunctionInOpenClassImpl(oci: OpenClassImpl, x: Int): String = oci.nonSuspendToSuspendFunction(x)
|
||||
fun suspendToNonSuspendFunctionWithDelegation(oci: OpenClassImpl, x: Int): String = runCoroutine { oci.suspendToNonSuspendFunctionWithDelegation(x) }
|
||||
fun nonSuspendToSuspendFunctionWithDelegation(oci: OpenClassImpl, x: Int): String = oci.nonSuspendToSuspendFunctionWithDelegation(x)
|
||||
|
||||
fun openNonInlineToInlineFunctionInOpenClass(oc: OpenClass, x: Int): String = oc.openNonInlineToInlineFunction(x)
|
||||
fun openNonInlineToInlineFunctionWithDelegationInOpenClass(oc: OpenClass, x: Int): String = oc.openNonInlineToInlineFunctionWithDelegation(x)
|
||||
fun newInlineFunction1InOpenClass(oc: OpenClass, x: Int): String = oc.newInlineFunction1Caller(x)
|
||||
fun newInlineFunction2InOpenClass(oc: OpenClass, x: Int): String = oc.newInlineFunction2Caller(x)
|
||||
fun newNonInlineFunctionInOpenClass(oc: OpenClass, x: Int): String = oc.newNonInlineFunctionCaller(x)
|
||||
fun openNonInlineToInlineFunctionInOpenClassImpl(oci: OpenClassImpl, x: Int): String = oci.openNonInlineToInlineFunction(x)
|
||||
fun openNonInlineToInlineFunctionWithDelegationInOpenClassImpl(oci: OpenClassImpl, x: Int): String = oci.openNonInlineToInlineFunctionWithDelegation(x)
|
||||
fun newInlineFunction1InOpenClassImpl(oci: OpenClassImpl, x: Int): String = oci.newInlineFunction1(x)
|
||||
fun newInlineFunction2InOpenClassImpl(oci: OpenClassImpl, x: Int): String = oci.newInlineFunction2(x)
|
||||
fun newNonInlineFunctionInOpenClassImpl(oci: OpenClassImpl, x: Int): String = oci.newNonInlineFunction(x)
|
||||
|
||||
fun inlineLambdaToNoinlineLambda(x: Int): String = Functions.inlineLambdaToNoinlineLambda(x) { if (it > 0) it.toString() else return "inlineLambdaToNoinlineLambda($x)" }
|
||||
fun inlineLambdaToCrossinlineLambda(x: Int): String = Functions.inlineLambdaToCrossinlineLambda(x) { if (it > 0) it.toString() else return "inlineLambdaToCrossinlineLambda($x)" }
|
||||
@@ -0,0 +1,122 @@
|
||||
@file:Suppress("RemoveRedundantSpreadOperator")
|
||||
|
||||
import abitestutils.abiTest
|
||||
|
||||
fun box() = abiTest {
|
||||
val ii: InterfaceImpl = InterfaceImpl()
|
||||
val i: Interface = ii
|
||||
val aci: AbstractClassImpl = AbstractClassImpl()
|
||||
val ac: AbstractClass = aci
|
||||
val oci: OpenClassImpl = OpenClassImpl()
|
||||
val oc: OpenClass = oci
|
||||
val soc: StableOpenClass = StableOpenClass()
|
||||
val sci: StableClassImpl = StableClassImpl()
|
||||
val sci2: StableClassImpl2 = StableClassImpl2()
|
||||
|
||||
expectSuccess("memberOperatorsToNonOperators: a=Alice,b=Bob") { memberOperatorsToNonOperators("a" to "Alice", "b" to "Bob") }
|
||||
expectSuccess("extensionOperatorsToNonOperators: a=Alice,b=Bob") { extensionOperatorsToNonOperators("a" to "Alice", "b" to "Bob") }
|
||||
expectSuccess("memberNonOperatorsToOperators: a=Alice,b=Bob") { memberNonOperatorsToOperators("a" to "Alice", "b" to "Bob") }
|
||||
expectSuccess("extensionNonOperatorsToOperators: a=Alice,b=Bob") { extensionNonOperatorsToOperators("a" to "Alice", "b" to "Bob") }
|
||||
|
||||
expectSuccess(3) { memberNonInfixToInfix(1, 2) }
|
||||
expectSuccess(3) { extensionNonInfixToInfix(1, 2) }
|
||||
expectSuccess(3) { memberInfixToNonInfix(1, 2) }
|
||||
expectSuccess(3) { extensionInfixToNonInfix(1, 2) }
|
||||
|
||||
expectSuccess(6) { nonTailrecToTailrec(3) }
|
||||
expectSuccess(6) { tailrecToNonTailrec(3) }
|
||||
|
||||
expectSuccess(142) { firstDefaultValueInFunctionInStableOpenClass(soc, 100) }
|
||||
expectSuccess(142) { lastDefaultValueInFunctionInStableOpenClass(soc, 100) }
|
||||
expectSuccess(142) { firstDefaultValueInFunctionInStableClassImpl(sci, 100) }
|
||||
expectSuccess(142) { lastDefaultValueInFunctionInStableClassImpl(sci, 100) }
|
||||
expectSuccess(-58) { firstDefaultValueInFunctionInStableClassImpl2(sci2, 100) }
|
||||
expectSuccess(58) { lastDefaultValueInFunctionInStableClassImpl2(sci2, 100) }
|
||||
|
||||
expectFailure(linkage("Function 'removedFirstDefaultValue' can not be called: The call site provides less value arguments (1) than the function requires (2)")) { removedFirstDefaultValueInFunction(1) }
|
||||
expectSuccess(100) { removedVarargFirstDefaultValueInFunction(100) } // Default IntArray value disappears. So it contrinutes 0 to the sum.
|
||||
expectFailure(linkage("Function 'removedLastDefaultValue' can not be called: The call site provides less value arguments (1) than the function requires (2)")) { removedLastDefaultValueInFunction(1) }
|
||||
expectSuccess(100) { removedVarargLastDefaultValueInFunction(100) } // Default IntArray value disappears. So it contrinutes 0 to the sum.
|
||||
expectFailure(linkage("Constructor 'RemovedFirstDefaultValueInConstructor.<init>' can not be called: The call site provides less value arguments (1) than the constructor requires (2)")) { removedFirstDefaultValueInConstructor(1) }
|
||||
expectFailure(linkage("Constructor 'RemovedLastDefaultValueInConstructor.<init>' can not be called: The call site provides less value arguments (1) than the constructor requires (2)")) { removedLastDefaultValueInConstructor(1) }
|
||||
|
||||
expectSuccess(0) { singleVarargArgument() }
|
||||
expectSuccess(1) { singleVarargArgument(1) }
|
||||
expectSuccess(3) { singleVarargArgument(1, 2) }
|
||||
expectSuccess(1) { singleVarargArgument(*intArrayOf(1)) }
|
||||
expectSuccess(3) { singleVarargArgument(*intArrayOf(1, 2)) }
|
||||
expectSuccess(-6) { singleVarargArgumentWithDefaultValue() }
|
||||
expectSuccess(1) { singleVarargArgumentWithDefaultValue(1) }
|
||||
expectSuccess(3) { singleVarargArgumentWithDefaultValue(1, 2) }
|
||||
expectSuccess(1) { singleVarargArgumentWithDefaultValue(*intArrayOf(1)) }
|
||||
expectSuccess(3) { singleVarargArgumentWithDefaultValue(*intArrayOf(1, 2)) }
|
||||
expectSuccess(110) { varargArgumentAndOtherArguments(100, last = 10) }
|
||||
expectSuccess(111) { varargArgumentAndOtherArguments(100, 1, last = 10) }
|
||||
expectSuccess(113) { varargArgumentAndOtherArguments(100, 1, 2, last = 10) }
|
||||
expectSuccess(111) { varargArgumentAndOtherArguments(100, *intArrayOf(1), last = 10) }
|
||||
expectSuccess(113) { varargArgumentAndOtherArguments(100, *intArrayOf(1, 2), last = 10) }
|
||||
expectSuccess(-110) { varargArgumentAndOtherArgumentsWithDefaultValues() }
|
||||
expectSuccess(90) { varargArgumentAndOtherArgumentsWithDefaultValues(100) }
|
||||
expectSuccess(110) { varargArgumentAndOtherArgumentsWithDefaultValues(100, last = 10) }
|
||||
expectSuccess(91) { varargArgumentAndOtherArgumentsWithDefaultValues(100, 1) }
|
||||
expectSuccess(93) { varargArgumentAndOtherArgumentsWithDefaultValues(100, 1, 2) }
|
||||
expectSuccess(113) { varargArgumentAndOtherArgumentsWithDefaultValues(100, 1, 2, last = 10) }
|
||||
expectSuccess(-109) { varargArgumentAndOtherArgumentsWithDefaultValues(elements = *intArrayOf(1)) }
|
||||
expectSuccess(-107) { varargArgumentAndOtherArgumentsWithDefaultValues(elements = *intArrayOf(1, 2)) }
|
||||
expectSuccess(104) { varargArgumentWithDefaultValueAndOtherArguments(100, last = 10) }
|
||||
expectSuccess(111) { varargArgumentWithDefaultValueAndOtherArguments(100, 1, last = 10) }
|
||||
expectSuccess(113) { varargArgumentWithDefaultValueAndOtherArguments(100, 1, 2, last = 10) }
|
||||
expectSuccess(111) { varargArgumentWithDefaultValueAndOtherArguments(100, *intArrayOf(1), last = 10) }
|
||||
expectSuccess(113) { varargArgumentWithDefaultValueAndOtherArguments(100, *intArrayOf(1, 2), last = 10) }
|
||||
expectSuccess(-116) { varargArgumentWithDefaultValueAndOtherArgumentsWithDefaultValues() }
|
||||
expectSuccess(84) { varargArgumentWithDefaultValueAndOtherArgumentsWithDefaultValues(100) }
|
||||
expectSuccess(104) { varargArgumentWithDefaultValueAndOtherArgumentsWithDefaultValues(100, last = 10) }
|
||||
expectSuccess(91) { varargArgumentWithDefaultValueAndOtherArgumentsWithDefaultValues(100, 1) }
|
||||
expectSuccess(93) { varargArgumentWithDefaultValueAndOtherArgumentsWithDefaultValues(100, 1, 2) }
|
||||
expectSuccess(113) { varargArgumentWithDefaultValueAndOtherArgumentsWithDefaultValues(100, 1, 2, last = 10) }
|
||||
expectSuccess(-109) { varargArgumentWithDefaultValueAndOtherArgumentsWithDefaultValues(elements = *intArrayOf(1)) }
|
||||
expectSuccess(-107) { varargArgumentWithDefaultValueAndOtherArgumentsWithDefaultValues(elements = *intArrayOf(1, 2)) }
|
||||
|
||||
expectSuccess(-1) { suspendToNonSuspendFunction1(1) }
|
||||
expectSuccess(-2) { suspendToNonSuspendFunction2(2) }
|
||||
expectSuccess(-3) { suspendToNonSuspendFunction3(3) }
|
||||
expectFailure(linkage("Function 'nonSuspendToSuspendFunction' can not be called: Suspend function can be called only from a coroutine or another suspend function")) { nonSuspendToSuspendFunction1(4) }
|
||||
expectSuccess(-5) { nonSuspendToSuspendFunction2(5) }
|
||||
expectFailure(linkage("Function 'nonSuspendToSuspendFunction' can not be called: Suspend function can be called only from a coroutine or another suspend function")) { nonSuspendToSuspendFunction3(6) }
|
||||
expectSuccess(-7) { nonSuspendToSuspendFunction4(7) }
|
||||
|
||||
expectFailure(linkage("Abstract function 'suspendToNonSuspendFunction' is not implemented in non-abstract class 'InterfaceImpl'")) { suspendToNonSuspendFunctionInInterface(i, 1) }
|
||||
expectFailure(linkage("Function 'nonSuspendToSuspendFunction' can not be called: Suspend function can be called only from a coroutine or another suspend function")) { nonSuspendToSuspendFunctionInInterface(i, 2) }
|
||||
expectSuccess("InterfaceImpl.suspendToNonSuspendFunction(3)") { suspendToNonSuspendFunctionInInterfaceImpl(ii, 3) }
|
||||
expectSuccess("InterfaceImpl.nonSuspendToSuspendFunction(4)") { nonSuspendToSuspendFunctionInInterfaceImpl(ii, 4) }
|
||||
|
||||
expectFailure(linkage("Abstract function 'suspendToNonSuspendFunction' is not implemented in non-abstract class 'AbstractClassImpl'")) { suspendToNonSuspendFunctionInAbstractClass(ac, 5) }
|
||||
expectFailure(linkage("Function 'nonSuspendToSuspendFunction' can not be called: Suspend function can be called only from a coroutine or another suspend function")) { nonSuspendToSuspendFunctionInAbstractClass(ac, 6) }
|
||||
expectSuccess("AbstractClassImpl.suspendToNonSuspendFunction(7)") { suspendToNonSuspendFunctionInAbstractClassImpl(aci, 7) }
|
||||
expectSuccess("AbstractClassImpl.nonSuspendToSuspendFunction(8)") { nonSuspendToSuspendFunctionInAbstractClassImpl(aci, 8) }
|
||||
|
||||
expectSuccess("OpenClassV2.suspendToNonSuspendFunction(9)") { suspendToNonSuspendFunctionInOpenClass(oc, 9) } // Function of the base class is called instead of overridden function in inherited class.
|
||||
expectFailure(linkage("Function 'nonSuspendToSuspendFunction' can not be called: Suspend function can be called only from a coroutine or another suspend function")) { nonSuspendToSuspendFunctionInOpenClass(oc, 10) }
|
||||
expectSuccess("OpenClassImpl.suspendToNonSuspendFunction(11)") { suspendToNonSuspendFunctionInOpenClassImpl(oci, 11) }
|
||||
expectSuccess("OpenClassImpl.nonSuspendToSuspendFunction(12)") { nonSuspendToSuspendFunctionInOpenClassImpl(oci, 12) }
|
||||
expectSuccess("OpenClassV2.suspendToNonSuspendFunctionWithDelegation(13) called from OpenClassImpl.suspendToNonSuspendFunctionWithDelegation(13)") { suspendToNonSuspendFunctionWithDelegation(oci, 13) }
|
||||
expectFailure(linkage("Function 'nonSuspendToSuspendFunctionWithDelegation' can not be called: Suspend function can be called only from a coroutine or another suspend function")) { nonSuspendToSuspendFunctionWithDelegation(oci, 14) }
|
||||
|
||||
expectSuccess("OpenClassV2.openNonInlineToInlineFunction(1)") { openNonInlineToInlineFunctionInOpenClass(oc, 1) }
|
||||
expectSuccess("OpenClassV2.openNonInlineToInlineFunctionWithDelegation(2)") { openNonInlineToInlineFunctionWithDelegationInOpenClass(oc, 2) }
|
||||
expectSuccess("OpenClassV2.newInlineFunction1(3)") { newInlineFunction1InOpenClass(oc, 3) }
|
||||
expectSuccess("OpenClassV2.newInlineFunction2(4)") { newInlineFunction2InOpenClass(oc, 4) }
|
||||
expectSuccess( // TODO: this should be fixed in JS, KT-56762
|
||||
if (testMode.isJs) "OpenClassImpl.newNonInlineFunction(5)" else "OpenClassV2.newNonInlineFunction(5)"
|
||||
) { newNonInlineFunctionInOpenClass(oc, 5) }
|
||||
expectSuccess("OpenClassImpl.openNonInlineToInlineFunction(6)") { openNonInlineToInlineFunctionInOpenClassImpl(oci, 6) }
|
||||
expectSuccess("OpenClassV2.openNonInlineToInlineFunctionWithDelegation(7) called from OpenClassImpl.openNonInlineToInlineFunctionWithDelegation(7)") { openNonInlineToInlineFunctionWithDelegationInOpenClassImpl(oci, 7) }
|
||||
expectSuccess("OpenClassImpl.newInlineFunction1(8)") { newInlineFunction1InOpenClassImpl(oci, 8) }
|
||||
expectSuccess("OpenClassImpl.newInlineFunction2(9)") { newInlineFunction2InOpenClassImpl(oci, 9) }
|
||||
expectSuccess("OpenClassImpl.newNonInlineFunction(10)") { newNonInlineFunctionInOpenClassImpl(oci, 10) }
|
||||
|
||||
expectSuccess("Functions.inlineLambdaToNoinlineLambda(3) { 6 }") { inlineLambdaToNoinlineLambda(3) }
|
||||
expectFailure(linkage("Illegal non-local return: The return target is function 'inlineLambdaToNoinlineLambda' while only the following return targets are allowed: lambda in function 'inlineLambdaToNoinlineLambda'")) { inlineLambdaToNoinlineLambda(-3) }
|
||||
expectSuccess("Functions.inlineLambdaToCrossinlineLambda(5) { 10 }") { inlineLambdaToCrossinlineLambda(5) }
|
||||
expectFailure(linkage("Illegal non-local return: The return target is function 'inlineLambdaToCrossinlineLambda' while only the following return targets are allowed: lambda in function 'inlineLambdaToCrossinlineLambda'")) { inlineLambdaToCrossinlineLambda(-5) }
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
interface InterfaceToAbstractClass
|
||||
interface InterfaceToOpenClass
|
||||
interface InterfaceToFinalClass
|
||||
interface InterfaceToAnnotationClass
|
||||
interface InterfaceToObject
|
||||
interface InterfaceToEnumClass
|
||||
interface InterfaceToValueClass
|
||||
interface InterfaceToDataClass
|
||||
|
||||
open class OpenClassToFinalClass(val x: Int)
|
||||
open class OpenClassToAnnotationClass(val x: Int)
|
||||
open class OpenClassToObject(val x: Int)
|
||||
open class OpenClassToEnumClass(val x: Int)
|
||||
open class OpenClassToValueClass(val x: Int)
|
||||
open class OpenClassToDataClass(val x: Int)
|
||||
open class OpenClassToInterface(val x: Int)
|
||||
|
||||
interface InterfaceToAbstractClass1
|
||||
interface InterfaceToAbstractClass2
|
||||
abstract class AbstractClass
|
||||
|
||||
interface RemovedInterface {
|
||||
fun abstractFun(): String
|
||||
fun abstractFunWithDefaultImpl(): String = "RemovedInterface.abstractFunWithDefaultImpl"
|
||||
val abstractVal: String
|
||||
val abstractValWithDefaultImpl: String get() = "RemovedInterface.abstractValWithDefaultImpl"
|
||||
}
|
||||
|
||||
abstract class RemovedAbstractClass {
|
||||
abstract fun abstractFun(): String
|
||||
open fun openFun(): String = "RemovedAbstractClass.openFun"
|
||||
fun finalFun(): String = "RemovedAbstractClass.finalFun"
|
||||
abstract val abstractVal: String
|
||||
open val openVal: String get() = "RemovedAbstractClass.openVal"
|
||||
val finalVal: String get() = "RemovedAbstractClass.finalVal"
|
||||
}
|
||||
|
||||
open class RemovedOpenClass {
|
||||
open fun openFun(): String = "RemovedOpenClass.openFun"
|
||||
fun finalFun(): String = "RemovedOpenClass.finalFun"
|
||||
open val openVal: String get() = "RemovedOpenClass.openVal"
|
||||
val finalVal: String get() = "RemovedOpenClass.finalVal"
|
||||
}
|
||||
|
||||
abstract class AbstractClassWithChangedConstructorSignature(name: String) {
|
||||
val greeting = "Hello, $name!"
|
||||
}
|
||||
|
||||
open class OpenClassWithChangedConstructorSignature(name: String) {
|
||||
val greeting = "Hello, $name!"
|
||||
}
|
||||
|
||||
open class SuperSuperClass {
|
||||
open fun inheritsFrom() = "SuperSuperClass -> Any"
|
||||
}
|
||||
open class SuperClass : SuperSuperClass() {
|
||||
override fun inheritsFrom() = "SuperClass -> " + super.inheritsFrom()
|
||||
}
|
||||
class SuperSuperClassReplacedBySuperClass : SuperSuperClass() {
|
||||
override fun inheritsFrom() = "SuperSuperClassReplacedBySuperClass -> " + super.inheritsFrom()
|
||||
}
|
||||
class SuperClassReplacedBySuperSuperClass : SuperClass() {
|
||||
override fun inheritsFrom() = "SuperClassReplacedBySuperSuperClass -> " + super.inheritsFrom()
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
abstract class InterfaceToAbstractClass
|
||||
open class InterfaceToOpenClass
|
||||
class InterfaceToFinalClass
|
||||
annotation class InterfaceToAnnotationClass
|
||||
object InterfaceToObject
|
||||
enum class InterfaceToEnumClass
|
||||
value class InterfaceToValueClass(val x: Int)
|
||||
data class InterfaceToDataClass(val x: Int)
|
||||
|
||||
final class OpenClassToFinalClass(val x: Int)
|
||||
annotation class OpenClassToAnnotationClass(val x: Int)
|
||||
object OpenClassToObject { val x: Int = 42 }
|
||||
enum class OpenClassToEnumClass(val x: Int)
|
||||
value class OpenClassToValueClass(val x: Int)
|
||||
data class OpenClassToDataClass(val x: Int)
|
||||
interface OpenClassToInterface { val x: Int }
|
||||
|
||||
abstract class InterfaceToAbstractClass1
|
||||
abstract class InterfaceToAbstractClass2
|
||||
abstract class AbstractClass
|
||||
|
||||
//interface RemovedInterface {
|
||||
// fun abstractFun(): String
|
||||
// fun abstractFunWithDefaultImpl(): String = "RemovedInterface.abstractFunWithDefaultImpl"
|
||||
// val abstractVal: String
|
||||
// val abstractValWithDefaultImpl: String get() = "RemovedInterface.abstractValWithDefaultImpl"
|
||||
//}
|
||||
//
|
||||
//abstract class RemovedAbstractClass {
|
||||
// abstract fun abstractFun(): String
|
||||
// open fun openFun(): String = "RemovedAbstractClass.openFun"
|
||||
// fun finalFun(): String = "RemovedAbstractClass.finalFun"
|
||||
// abstract val abstractVal: String
|
||||
// open val openVal: String get() = "RemovedAbstractClass.openVal"
|
||||
// val finalVal: String get() = "RemovedAbstractClass.finalVal"
|
||||
//}
|
||||
//
|
||||
//open class RemovedOpenClass {
|
||||
// open fun openFun(): String = "RemovedOpenClass.openFun"
|
||||
// fun finalFun(): String = "RemovedOpenClass.finalFun"
|
||||
// open val openVal: String get() = "RemovedOpenClass.openVal"
|
||||
// val finalVal: String get() = "RemovedOpenClass.finalVal"
|
||||
//}
|
||||
|
||||
abstract class AbstractClassWithChangedConstructorSignature(name: String, city: String) {
|
||||
val greeting = "Hello, $name from $city!"
|
||||
}
|
||||
|
||||
open class OpenClassWithChangedConstructorSignature(name: String, city: String) {
|
||||
val greeting = "Hello, $name from $city!"
|
||||
}
|
||||
|
||||
open class SuperSuperClass {
|
||||
open fun inheritsFrom() = "SuperSuperClass -> Any"
|
||||
}
|
||||
open class SuperClass : SuperSuperClass() {
|
||||
override fun inheritsFrom() = "SuperClass -> " + super.inheritsFrom()
|
||||
}
|
||||
class SuperSuperClassReplacedBySuperClass : /*SuperSuperClass()*/ SuperClass() {
|
||||
override fun inheritsFrom() = "SuperSuperClassReplacedBySuperClass -> " + super.inheritsFrom()
|
||||
}
|
||||
class SuperClassReplacedBySuperSuperClass : /*SuperClass()*/ SuperSuperClass() {
|
||||
override fun inheritsFrom() = "SuperClassReplacedBySuperSuperClass -> " + super.inheritsFrom()
|
||||
}
|
||||
@@ -0,0 +1,253 @@
|
||||
fun getInterfaceToAbstractClass() = object : InterfaceToAbstractClass {}
|
||||
inline fun getInterfaceToAbstractClassInline() = object : InterfaceToAbstractClass {}
|
||||
fun getInterfaceToAbstractClassAsAny(): Any = object : InterfaceToAbstractClass {}
|
||||
inline fun getInterfaceToAbstractClassAsAnyInline(): Any = object : InterfaceToAbstractClass {}
|
||||
fun getInterfaceToAbstractClassAsAny2(): Any { class Local : InterfaceToAbstractClass; return Local() }
|
||||
|
||||
fun getInterfaceToOpenClass() = object : InterfaceToOpenClass {}
|
||||
inline fun getInterfaceToOpenClassInline() = object : InterfaceToOpenClass {}
|
||||
fun getInterfaceToOpenClassAsAny(): Any = object : InterfaceToOpenClass {}
|
||||
inline fun getInterfaceToOpenClassAsAnyInline(): Any = object : InterfaceToOpenClass {}
|
||||
fun getInterfaceToOpenClassAsAny2(): Any { class Local : InterfaceToOpenClass; return Local() }
|
||||
|
||||
fun getInterfaceToFinalClass() = object : InterfaceToFinalClass {}
|
||||
inline fun getInterfaceToFinalClassInline() = object : InterfaceToFinalClass {}
|
||||
fun getInterfaceToFinalClassAsAny(): Any = object : InterfaceToFinalClass {}
|
||||
inline fun getInterfaceToFinalClassAsAnyInline(): Any = object : InterfaceToFinalClass {}
|
||||
fun getInterfaceToFinalClassAsAny2(): Any { class Local : InterfaceToFinalClass; return Local() }
|
||||
|
||||
open class InterfaceToAbstractClassImpl : InterfaceToAbstractClass
|
||||
class InterfaceToAbstractClassImpl2 : InterfaceToAbstractClassImpl()
|
||||
open class InterfaceToOpenClassImpl : InterfaceToOpenClass
|
||||
class InterfaceToOpenClassImpl2 : InterfaceToOpenClassImpl()
|
||||
open class InterfaceToFinalClassImpl : InterfaceToFinalClass
|
||||
class InterfaceToFinalClassImpl2 : InterfaceToFinalClassImpl()
|
||||
|
||||
class InterfaceToAbstractClassContainer {
|
||||
open class InterfaceToAbstractClassImpl : InterfaceToAbstractClass
|
||||
class InterfaceToAbstractClassImpl2 : InterfaceToAbstractClassImpl()
|
||||
inner class InterfaceToAbstractClassInnerImpl : InterfaceToAbstractClass
|
||||
}
|
||||
class InterfaceToOpenClassContainer {
|
||||
open class InterfaceToOpenClassImpl : InterfaceToOpenClass
|
||||
class InterfaceToOpenClassImpl2 : InterfaceToOpenClassImpl()
|
||||
inner class InterfaceToOpenClassInnerImpl : InterfaceToOpenClass
|
||||
}
|
||||
class InterfaceToFinalClassContainer {
|
||||
open class InterfaceToFinalClassImpl : InterfaceToFinalClass
|
||||
class InterfaceToFinalClassImpl2 : InterfaceToFinalClassImpl()
|
||||
inner class InterfaceToFinalClassInnerImpl : InterfaceToFinalClass
|
||||
}
|
||||
|
||||
fun getInterfaceToAbstractClassImpl() = InterfaceToAbstractClassImpl()
|
||||
inline fun getInterfaceToAbstractClassImplInline() = InterfaceToAbstractClassImpl()
|
||||
fun getInterfaceToAbstractClassImplAsAny(): Any = InterfaceToAbstractClassImpl()
|
||||
inline fun getInterfaceToAbstractClassImplAsAnyInline(): Any = InterfaceToAbstractClassImpl()
|
||||
|
||||
fun getInterfaceToAbstractClassImpl2() = InterfaceToAbstractClassImpl2()
|
||||
inline fun getInterfaceToAbstractClassImpl2Inline() = InterfaceToAbstractClassImpl2()
|
||||
fun getInterfaceToAbstractClassImpl2AsAny(): Any = InterfaceToAbstractClassImpl2()
|
||||
inline fun getInterfaceToAbstractClassImpl2AsAnyInline(): Any = InterfaceToAbstractClassImpl2()
|
||||
|
||||
fun getInterfaceToOpenClassImpl() = InterfaceToOpenClassImpl()
|
||||
inline fun getInterfaceToOpenClassImplInline() = InterfaceToOpenClassImpl()
|
||||
fun getInterfaceToOpenClassImplAsAny(): Any = InterfaceToOpenClassImpl()
|
||||
inline fun getInterfaceToOpenClassImplAsAnyInline(): Any = InterfaceToOpenClassImpl()
|
||||
|
||||
fun getInterfaceToOpenClassImpl2() = InterfaceToOpenClassImpl2()
|
||||
inline fun getInterfaceToOpenClassImpl2Inline() = InterfaceToOpenClassImpl2()
|
||||
fun getInterfaceToOpenClassImpl2AsAny(): Any = InterfaceToOpenClassImpl2()
|
||||
inline fun getInterfaceToOpenClassImpl2AsAnyInline(): Any = InterfaceToOpenClassImpl2()
|
||||
|
||||
fun getInterfaceToFinalClassImpl() = InterfaceToFinalClassImpl()
|
||||
inline fun getInterfaceToFinalClassImplInline() = InterfaceToFinalClassImpl()
|
||||
fun getInterfaceToFinalClassImplAsAny(): Any = InterfaceToFinalClassImpl()
|
||||
inline fun getInterfaceToFinalClassImplAsAnyInline(): Any = InterfaceToFinalClassImpl()
|
||||
|
||||
fun getInterfaceToFinalClassImpl2() = InterfaceToFinalClassImpl2()
|
||||
inline fun getInterfaceToFinalClassImpl2Inline() = InterfaceToFinalClassImpl2()
|
||||
fun getInterfaceToFinalClassImpl2AsAny(): Any = InterfaceToFinalClassImpl2()
|
||||
inline fun getInterfaceToFinalClassImpl2AsAnyInline(): Any = InterfaceToFinalClassImpl2()
|
||||
|
||||
fun getInterfaceToAbstractClassNestedImpl() = InterfaceToAbstractClassContainer.InterfaceToAbstractClassImpl()
|
||||
inline fun getInterfaceToAbstractClassNestedImplInline() = InterfaceToAbstractClassContainer.InterfaceToAbstractClassImpl()
|
||||
fun getInterfaceToAbstractClassNestedImplAsAny(): Any = InterfaceToAbstractClassContainer.InterfaceToAbstractClassImpl()
|
||||
inline fun getInterfaceToAbstractClassNestedImplAsAnyInline(): Any = InterfaceToAbstractClassContainer.InterfaceToAbstractClassImpl()
|
||||
|
||||
fun getInterfaceToAbstractClassNestedImpl2() = InterfaceToAbstractClassContainer.InterfaceToAbstractClassImpl2()
|
||||
inline fun getInterfaceToAbstractClassNestedImpl2Inline() = InterfaceToAbstractClassContainer.InterfaceToAbstractClassImpl2()
|
||||
fun getInterfaceToAbstractClassNestedImpl2AsAny(): Any = InterfaceToAbstractClassContainer.InterfaceToAbstractClassImpl2()
|
||||
inline fun getInterfaceToAbstractClassNestedImpl2AsAnyInline(): Any = InterfaceToAbstractClassContainer.InterfaceToAbstractClassImpl2()
|
||||
|
||||
fun getInterfaceToAbstractClassInnerImpl() = InterfaceToAbstractClassContainer().InterfaceToAbstractClassInnerImpl()
|
||||
inline fun getInterfaceToAbstractClassInnerImplInline() = InterfaceToAbstractClassContainer().InterfaceToAbstractClassInnerImpl()
|
||||
fun getInterfaceToAbstractClassInnerImplAsAny(): Any = InterfaceToAbstractClassContainer().InterfaceToAbstractClassInnerImpl()
|
||||
inline fun getInterfaceToAbstractClassInnerImplAsAnyInline(): Any = InterfaceToAbstractClassContainer().InterfaceToAbstractClassInnerImpl()
|
||||
|
||||
fun getInterfaceToOpenClassNestedImpl() = InterfaceToOpenClassContainer.InterfaceToOpenClassImpl()
|
||||
inline fun getInterfaceToOpenClassNestedImplInline() = InterfaceToOpenClassContainer.InterfaceToOpenClassImpl()
|
||||
fun getInterfaceToOpenClassNestedImplAsAny(): Any = InterfaceToOpenClassContainer.InterfaceToOpenClassImpl()
|
||||
inline fun getInterfaceToOpenClassNestedImplAsAnyInline(): Any = InterfaceToOpenClassContainer.InterfaceToOpenClassImpl()
|
||||
|
||||
fun getInterfaceToOpenClassNestedImpl2() = InterfaceToOpenClassContainer.InterfaceToOpenClassImpl2()
|
||||
inline fun getInterfaceToOpenClassNestedImpl2Inline() = InterfaceToOpenClassContainer.InterfaceToOpenClassImpl2()
|
||||
fun getInterfaceToOpenClassNestedImpl2AsAny(): Any = InterfaceToOpenClassContainer.InterfaceToOpenClassImpl2()
|
||||
inline fun getInterfaceToOpenClassNestedImpl2AsAnyInline(): Any = InterfaceToOpenClassContainer.InterfaceToOpenClassImpl2()
|
||||
|
||||
fun getInterfaceToOpenClassInnerImpl() = InterfaceToOpenClassContainer().InterfaceToOpenClassInnerImpl()
|
||||
inline fun getInterfaceToOpenClassInnerImplInline() = InterfaceToOpenClassContainer().InterfaceToOpenClassInnerImpl()
|
||||
fun getInterfaceToOpenClassInnerImplAsAny(): Any = InterfaceToOpenClassContainer().InterfaceToOpenClassInnerImpl()
|
||||
inline fun getInterfaceToOpenClassInnerImplAsAnyInline(): Any = InterfaceToOpenClassContainer().InterfaceToOpenClassInnerImpl()
|
||||
|
||||
fun getInterfaceToFinalClassNestedImpl() = InterfaceToFinalClassContainer.InterfaceToFinalClassImpl()
|
||||
inline fun getInterfaceToFinalClassNestedImplInline() = InterfaceToFinalClassContainer.InterfaceToFinalClassImpl()
|
||||
fun getInterfaceToFinalClassNestedImplAsAny(): Any = InterfaceToFinalClassContainer.InterfaceToFinalClassImpl()
|
||||
inline fun getInterfaceToFinalClassNestedImplAsAnyInline(): Any = InterfaceToFinalClassContainer.InterfaceToFinalClassImpl()
|
||||
|
||||
fun getInterfaceToFinalClassNestedImpl2() = InterfaceToFinalClassContainer.InterfaceToFinalClassImpl2()
|
||||
inline fun getInterfaceToFinalClassNestedImpl2Inline() = InterfaceToFinalClassContainer.InterfaceToFinalClassImpl2()
|
||||
fun getInterfaceToFinalClassNestedImpl2AsAny(): Any = InterfaceToFinalClassContainer.InterfaceToFinalClassImpl2()
|
||||
inline fun getInterfaceToFinalClassNestedImpl2AsAnyInline(): Any = InterfaceToFinalClassContainer.InterfaceToFinalClassImpl2()
|
||||
|
||||
fun getInterfaceToFinalClassInnerImpl() = InterfaceToFinalClassContainer().InterfaceToFinalClassInnerImpl()
|
||||
inline fun getInterfaceToFinalClassInnerImplInline() = InterfaceToFinalClassContainer().InterfaceToFinalClassInnerImpl()
|
||||
fun getInterfaceToFinalClassInnerImplAsAny(): Any = InterfaceToFinalClassContainer().InterfaceToFinalClassInnerImpl()
|
||||
inline fun getInterfaceToFinalClassInnerImplAsAnyInline(): Any = InterfaceToFinalClassContainer().InterfaceToFinalClassInnerImpl()
|
||||
|
||||
fun referenceToInterfaceToAbstractClassImpl() = InterfaceToAbstractClassImpl::class.simpleName.orEmpty()
|
||||
inline fun referenceToInterfaceToAbstractClassImplInline() = InterfaceToAbstractClassImpl::class.simpleName.orEmpty()
|
||||
fun referenceToInterfaceToAbstractClassImpl2() = InterfaceToAbstractClassImpl2::class.simpleName.orEmpty()
|
||||
inline fun referenceToInterfaceToAbstractClassImpl2Inline() = InterfaceToAbstractClassImpl2::class.simpleName.orEmpty()
|
||||
|
||||
fun referenceToInterfaceToFinalClassImpl() = check(InterfaceToFinalClassImpl::class.simpleName != null)
|
||||
inline fun referenceToInterfaceToFinalClassImplInline() = check(InterfaceToFinalClassImpl::class.simpleName != null)
|
||||
fun referenceToInterfaceToFinalClassImpl2() = check(InterfaceToFinalClassImpl2::class.simpleName != null)
|
||||
inline fun referenceToInterfaceToFinalClassImpl2Inline() = check(InterfaceToFinalClassImpl2::class.simpleName != null)
|
||||
|
||||
class InterfaceToAnnotationClassImpl : InterfaceToAnnotationClass
|
||||
class InterfaceToObjectImpl : InterfaceToObject
|
||||
class InterfaceToEnumClassImpl : InterfaceToEnumClass
|
||||
class InterfaceToValueClassImpl : InterfaceToValueClass
|
||||
class InterfaceToDataClassImpl : InterfaceToDataClass
|
||||
|
||||
fun getInterfaceToAnnotationClassImpl() = InterfaceToAnnotationClassImpl()
|
||||
fun getInterfaceToAnnotationClassImplAsAny(): Any = InterfaceToAnnotationClassImpl()
|
||||
fun getInterfaceToObjectImpl() = InterfaceToObjectImpl()
|
||||
fun getInterfaceToObjectImplAsAny(): Any = InterfaceToObjectImpl()
|
||||
fun getInterfaceToEnumClassImpl() = InterfaceToEnumClassImpl()
|
||||
fun getInterfaceToEnumClassImplAsAny(): Any = InterfaceToEnumClassImpl()
|
||||
fun getInterfaceToValueClassImpl() = InterfaceToValueClassImpl()
|
||||
fun getInterfaceToValueClassImplAny(): Any = InterfaceToValueClassImpl()
|
||||
fun getInterfaceToDataClassImpl() = InterfaceToDataClassImpl()
|
||||
fun getInterfaceToDataClassImplAny(): Any = InterfaceToDataClassImpl()
|
||||
|
||||
class OpenClassToFinalClassImpl : OpenClassToFinalClass(42)
|
||||
class OpenClassToAnnotationClassImpl : OpenClassToAnnotationClass(42)
|
||||
class OpenClassToObjectImpl : OpenClassToObject(42)
|
||||
class OpenClassToEnumClassImpl : OpenClassToEnumClass(42)
|
||||
class OpenClassToValueClassImpl : OpenClassToValueClass(42)
|
||||
class OpenClassToDataClassImpl : OpenClassToDataClass(42)
|
||||
class OpenClassToInterfaceImpl : OpenClassToInterface(42)
|
||||
|
||||
fun getOpenClassToFinalClassImpl() = OpenClassToFinalClassImpl()
|
||||
fun getOpenClassToFinalClassImplAsAny(): Any = OpenClassToFinalClassImpl()
|
||||
fun getOpenClassToAnnotationClassImpl() = OpenClassToAnnotationClassImpl()
|
||||
fun getOpenClassToAnnotationClassImplAsAny(): Any = OpenClassToAnnotationClassImpl()
|
||||
fun getOpenClassToObjectImpl() = OpenClassToObjectImpl()
|
||||
fun getOpenClassToObjectImplAsAny(): Any = OpenClassToObjectImpl()
|
||||
fun getOpenClassToEnumClassImpl() = OpenClassToEnumClassImpl()
|
||||
fun getOpenClassToEnumClassImplAsAny(): Any = OpenClassToEnumClassImpl()
|
||||
fun getOpenClassToValueClassImpl() = OpenClassToValueClassImpl()
|
||||
fun getOpenClassToValueClassImplAsAny(): Any = OpenClassToValueClassImpl()
|
||||
fun getOpenClassToDataClassImpl() = OpenClassToDataClassImpl()
|
||||
fun getOpenClassToDataClassImplAsAny(): Any = OpenClassToDataClassImpl()
|
||||
fun getOpenClassToInterfaceImpl() = OpenClassToInterfaceImpl()
|
||||
fun getOpenClassToInterfaceImplAsAny(): Any = OpenClassToInterfaceImpl()
|
||||
|
||||
value class ValueClassInheritsAbstractClass(val x: Int) : InterfaceToAbstractClass
|
||||
enum class EnumClassInheritsAbstractClass : InterfaceToAbstractClass { ENTRY }
|
||||
|
||||
fun getValueClassInheritsAbstractClass() = ValueClassInheritsAbstractClass(42)
|
||||
fun getValueClassInheritsAbstractClassAsAny(): Any = ValueClassInheritsAbstractClass(42)
|
||||
fun getEnumClassInheritsAbstractClass() = EnumClassInheritsAbstractClass.ENTRY
|
||||
fun getEnumClassInheritsAbstractClassAsAny(): Any = EnumClassInheritsAbstractClass.ENTRY
|
||||
|
||||
fun getInterfaceToAbstractClass12_1(): InterfaceToAbstractClass1 = object : InterfaceToAbstractClass1, InterfaceToAbstractClass2 {}
|
||||
inline fun getInterfaceToAbstractClass12_1Inline(): InterfaceToAbstractClass1 = object : InterfaceToAbstractClass1, InterfaceToAbstractClass2 {}
|
||||
fun getInterfaceToAbstractClass12_2(): InterfaceToAbstractClass2 = object : InterfaceToAbstractClass1, InterfaceToAbstractClass2 {}
|
||||
inline fun getInterfaceToAbstractClass12_2Inline(): InterfaceToAbstractClass2 = object : InterfaceToAbstractClass1, InterfaceToAbstractClass2 {}
|
||||
fun getInterfaceToAbstractClass12AsAny(): Any = object : InterfaceToAbstractClass1, InterfaceToAbstractClass2 {}
|
||||
inline fun getInterfaceToAbstractClass12AsAnyInline(): Any = object : InterfaceToAbstractClass1, InterfaceToAbstractClass2 {}
|
||||
|
||||
fun getInterfaceToAbstractClassAndAbstractClass_1(): InterfaceToAbstractClass1 = object : InterfaceToAbstractClass1, AbstractClass() {}
|
||||
inline fun getInterfaceToAbstractClassAndAbstractClass_1Inline(): InterfaceToAbstractClass1 = object : InterfaceToAbstractClass1, AbstractClass() {}
|
||||
fun getInterfaceToAbstractClassAndAbstractClass_2(): AbstractClass = object : InterfaceToAbstractClass1, AbstractClass() {}
|
||||
inline fun getInterfaceToAbstractClassAndAbstractClass_2Inline(): AbstractClass = object : InterfaceToAbstractClass1, AbstractClass() {}
|
||||
fun getInterfaceToAbstractClassAndAbstractClassAsAny(): Any = object : InterfaceToAbstractClass1, AbstractClass() {}
|
||||
inline fun getInterfaceToAbstractClassAndAbstractClassAsAnyInline(): Any = object : InterfaceToAbstractClass1, AbstractClass() {}
|
||||
|
||||
open class InterfaceToAbstractClass12Impl : InterfaceToAbstractClass1, InterfaceToAbstractClass2
|
||||
class InterfaceToAbstractClass12Impl2 : InterfaceToAbstractClass12Impl()
|
||||
open class InterfaceToAbstractClassAndAbstractClassImpl : InterfaceToAbstractClass1, AbstractClass()
|
||||
class InterfaceToAbstractClassAndAbstractClassImpl2 : InterfaceToAbstractClassAndAbstractClassImpl()
|
||||
|
||||
fun getInterfaceToAbstractClass12Impl() = InterfaceToAbstractClass12Impl()
|
||||
inline fun getInterfaceToAbstractClass12ImplInline() = InterfaceToAbstractClass12Impl()
|
||||
fun getInterfaceToAbstractClass12ImplAsAny(): Any = InterfaceToAbstractClass12Impl()
|
||||
inline fun getInterfaceToAbstractClass12ImplAsAnyInline(): Any = InterfaceToAbstractClass12Impl()
|
||||
|
||||
fun getInterfaceToAbstractClass12Impl2() = InterfaceToAbstractClass12Impl2()
|
||||
inline fun getInterfaceToAbstractClass12Impl2Inline() = InterfaceToAbstractClass12Impl2()
|
||||
fun getInterfaceToAbstractClass12Impl2AsAny(): Any = InterfaceToAbstractClass12Impl2()
|
||||
inline fun getInterfaceToAbstractClass12Impl2AsAnyInline(): Any = InterfaceToAbstractClass12Impl2()
|
||||
|
||||
fun getInterfaceToAbstractClassAndAbstractClassImpl() = InterfaceToAbstractClassAndAbstractClassImpl()
|
||||
inline fun getInterfaceToAbstractClassAndAbstractClassImplInline() = InterfaceToAbstractClassAndAbstractClassImpl()
|
||||
fun getInterfaceToAbstractClassAndAbstractClassImplAsAny(): Any = InterfaceToAbstractClassAndAbstractClassImpl()
|
||||
inline fun getInterfaceToAbstractClassAndAbstractClassImplAsAnyInline(): Any = InterfaceToAbstractClassAndAbstractClassImpl()
|
||||
|
||||
fun getInterfaceToAbstractClassAndAbstractClassImpl2() = InterfaceToAbstractClassAndAbstractClassImpl2()
|
||||
inline fun getInterfaceToAbstractClassAndAbstractClassImpl2Inline() = InterfaceToAbstractClassAndAbstractClassImpl2()
|
||||
fun getInterfaceToAbstractClassAndAbstractClassImpl2AsAny(): Any = InterfaceToAbstractClassAndAbstractClassImpl2()
|
||||
inline fun getInterfaceToAbstractClassAndAbstractClassImpl2AsAnyInline(): Any = InterfaceToAbstractClassAndAbstractClassImpl2()
|
||||
|
||||
fun referenceToInterfaceToAbstractClass12Impl() = check(InterfaceToAbstractClass12Impl::class.simpleName != null)
|
||||
inline fun referenceToInterfaceToAbstractClass12ImplInline() = check(InterfaceToAbstractClass12Impl::class.simpleName != null)
|
||||
fun referenceToInterfaceToAbstractClass12Impl2Impl() = check(InterfaceToAbstractClass12Impl2::class.simpleName != null)
|
||||
inline fun referenceToInterfaceToAbstractClass12Impl2Inline() = check(InterfaceToAbstractClass12Impl2::class.simpleName != null)
|
||||
fun referenceToInterfaceToAbstractClassAndAbstractClassImpl() = check(InterfaceToAbstractClassAndAbstractClassImpl::class.simpleName != null)
|
||||
inline fun referenceToInterfaceToAbstractClassAndAbstractClassImplInline() = check(InterfaceToAbstractClassAndAbstractClassImpl::class.simpleName != null)
|
||||
fun referenceToInterfaceToAbstractClassAndAbstractClassImpl2Impl() = check(InterfaceToAbstractClassAndAbstractClassImpl2::class.simpleName != null)
|
||||
inline fun referenceToInterfaceToAbstractClassAndAbstractClassImpl2Inline() = check(InterfaceToAbstractClassAndAbstractClassImpl2::class.simpleName != null)
|
||||
|
||||
class RemovedInterfaceImpl1 : RemovedInterface {
|
||||
override fun abstractFun() = "RemovedInterfaceImpl1.abstractFun"
|
||||
override val abstractVal get() = "RemovedInterfaceImpl1.abstractVal"
|
||||
}
|
||||
|
||||
class RemovedInterfaceImpl2 : RemovedInterface {
|
||||
override fun abstractFun() = abstractFunWithDefaultImpl()
|
||||
override val abstractVal get() = abstractValWithDefaultImpl
|
||||
}
|
||||
|
||||
class RemovedAbstractClassImpl1 : RemovedAbstractClass() {
|
||||
override fun abstractFun() = "RemovedAbstractClassImpl1.abstractFun"
|
||||
override fun openFun() = "RemovedAbstractClassImpl1.openFun"
|
||||
override val abstractVal get() = "RemovedAbstractClassImpl1.abstractVal"
|
||||
override val openVal get() = "RemovedAbstractClassImpl1.openVal"
|
||||
}
|
||||
|
||||
class RemovedAbstractClassImpl2 : RemovedAbstractClass() {
|
||||
override fun abstractFun() = "${openFun()}:${finalFun()}"
|
||||
override val abstractVal get() = "$openVal: $finalVal"
|
||||
}
|
||||
|
||||
class RemovedOpenClassImpl1 : RemovedOpenClass() {
|
||||
override fun openFun() = "RemovedOpenClassImpl1.openFun"
|
||||
override val openVal get() = "RemovedOpenClassImpl1.openVal"
|
||||
}
|
||||
|
||||
class RemovedOpenClassImpl2 : RemovedOpenClass()
|
||||
|
||||
class AbstractClassWithChangedConstructorSignatureImpl() : AbstractClassWithChangedConstructorSignature("Alice")
|
||||
class OpenClassWithChangedConstructorSignatureImpl() : OpenClassWithChangedConstructorSignature("Bob")
|
||||
@@ -0,0 +1,234 @@
|
||||
import abitestutils.abiTest
|
||||
|
||||
fun box() = abiTest {
|
||||
val removedInterfaceImpl1 = RemovedInterfaceImpl1()
|
||||
val removedInterfaceImpl2 = RemovedInterfaceImpl2()
|
||||
val removedAbstractClassImpl1 = RemovedAbstractClassImpl1()
|
||||
val removedAbstractClassImpl2 = RemovedAbstractClassImpl2()
|
||||
val removedOpenClassImpl1 = RemovedOpenClassImpl1()
|
||||
val removedOpenClassImpl2 = RemovedOpenClassImpl2()
|
||||
val superSuperClassReplacedBySuperClass = SuperSuperClassReplacedBySuperClass()
|
||||
val superClassReplacedBySuperSuperClass = SuperClassReplacedBySuperSuperClass()
|
||||
|
||||
expectFailure(linkage("Anonymous object initialization error: Constructor '<init>' should call a constructor of direct super class 'InterfaceToAbstractClass' but calls 'Any.<init>' instead")) { getInterfaceToAbstractClass() }
|
||||
expectFailure(linkage("Anonymous object initialization error: Constructor '<init>' should call a constructor of direct super class 'InterfaceToAbstractClass' but calls 'Any.<init>' instead")) { getInterfaceToAbstractClassInline() }
|
||||
expectFailure(linkage("Anonymous object initialization error: Constructor '<init>' should call a constructor of direct super class 'InterfaceToAbstractClass' but calls 'Any.<init>' instead")) { getInterfaceToAbstractClassAsAny() }
|
||||
expectFailure(linkage("Anonymous object initialization error: Constructor '<init>' should call a constructor of direct super class 'InterfaceToAbstractClass' but calls 'Any.<init>' instead")) { getInterfaceToAbstractClassAsAnyInline() }
|
||||
expectFailure(linkage("Class initialization error: Constructor 'Local.<init>' should call a constructor of direct super class 'InterfaceToAbstractClass' but calls 'Any.<init>' instead")) { getInterfaceToAbstractClassAsAny2() }
|
||||
|
||||
expectFailure(linkage("Anonymous object initialization error: Constructor '<init>' should call a constructor of direct super class 'InterfaceToOpenClass' but calls 'Any.<init>' instead")) { getInterfaceToOpenClass() }
|
||||
expectFailure(linkage("Anonymous object initialization error: Constructor '<init>' should call a constructor of direct super class 'InterfaceToOpenClass' but calls 'Any.<init>' instead")) { getInterfaceToOpenClassInline() }
|
||||
expectFailure(linkage("Anonymous object initialization error: Constructor '<init>' should call a constructor of direct super class 'InterfaceToOpenClass' but calls 'Any.<init>' instead")) { getInterfaceToOpenClassAsAny() }
|
||||
expectFailure(linkage("Anonymous object initialization error: Constructor '<init>' should call a constructor of direct super class 'InterfaceToOpenClass' but calls 'Any.<init>' instead")) { getInterfaceToOpenClassAsAnyInline() }
|
||||
expectFailure(linkage("Class initialization error: Constructor 'Local.<init>' should call a constructor of direct super class 'InterfaceToOpenClass' but calls 'Any.<init>' instead")) { getInterfaceToOpenClassAsAny2() }
|
||||
|
||||
expectFailure(linkage("Constructor '<init>' can not be called: Anonymous object inherits from final class 'InterfaceToFinalClass'")) { getInterfaceToFinalClass() }
|
||||
expectFailure(linkage("Constructor '<init>' can not be called: Anonymous object inherits from final class 'InterfaceToFinalClass'")) { getInterfaceToFinalClassInline() }
|
||||
expectFailure(linkage("Constructor '<init>' can not be called: Anonymous object inherits from final class 'InterfaceToFinalClass'")) { getInterfaceToFinalClassAsAny() }
|
||||
expectFailure(linkage("Constructor '<init>' can not be called: Anonymous object inherits from final class 'InterfaceToFinalClass'")) { getInterfaceToFinalClassAsAnyInline() }
|
||||
expectFailure(linkage("Constructor 'Local.<init>' can not be called: Class 'Local' inherits from final class 'InterfaceToFinalClass'")) { getInterfaceToFinalClassAsAny2() }
|
||||
|
||||
expectFailure(linkage("Class initialization error: Constructor 'InterfaceToAbstractClassImpl.<init>' should call a constructor of direct super class 'InterfaceToAbstractClass' but calls 'Any.<init>' instead")) { getInterfaceToAbstractClassImpl() }
|
||||
expectFailure(linkage("Class initialization error: Constructor 'InterfaceToAbstractClassImpl.<init>' should call a constructor of direct super class 'InterfaceToAbstractClass' but calls 'Any.<init>' instead")) { getInterfaceToAbstractClassImplInline() }
|
||||
expectFailure(linkage("Class initialization error: Constructor 'InterfaceToAbstractClassImpl.<init>' should call a constructor of direct super class 'InterfaceToAbstractClass' but calls 'Any.<init>' instead")) { getInterfaceToAbstractClassImplAsAny() }
|
||||
expectFailure(linkage("Class initialization error: Constructor 'InterfaceToAbstractClassImpl.<init>' should call a constructor of direct super class 'InterfaceToAbstractClass' but calls 'Any.<init>' instead")) { getInterfaceToAbstractClassImplAsAnyInline() }
|
||||
|
||||
expectFailure(linkage("Class initialization error: Constructor 'InterfaceToAbstractClassImpl.<init>' should call a constructor of direct super class 'InterfaceToAbstractClass' but calls 'Any.<init>' instead")) { getInterfaceToAbstractClassImpl2() }
|
||||
expectFailure(linkage("Class initialization error: Constructor 'InterfaceToAbstractClassImpl.<init>' should call a constructor of direct super class 'InterfaceToAbstractClass' but calls 'Any.<init>' instead")) { getInterfaceToAbstractClassImpl2Inline() }
|
||||
expectFailure(linkage("Class initialization error: Constructor 'InterfaceToAbstractClassImpl.<init>' should call a constructor of direct super class 'InterfaceToAbstractClass' but calls 'Any.<init>' instead")) { getInterfaceToAbstractClassImpl2AsAny() }
|
||||
expectFailure(linkage("Class initialization error: Constructor 'InterfaceToAbstractClassImpl.<init>' should call a constructor of direct super class 'InterfaceToAbstractClass' but calls 'Any.<init>' instead")) { getInterfaceToAbstractClassImpl2AsAnyInline() }
|
||||
|
||||
expectFailure(linkage("Class initialization error: Constructor 'InterfaceToOpenClassImpl.<init>' should call a constructor of direct super class 'InterfaceToOpenClass' but calls 'Any.<init>' instead")) { getInterfaceToOpenClassImpl() }
|
||||
expectFailure(linkage("Class initialization error: Constructor 'InterfaceToOpenClassImpl.<init>' should call a constructor of direct super class 'InterfaceToOpenClass' but calls 'Any.<init>' instead")) { getInterfaceToOpenClassImplInline() }
|
||||
expectFailure(linkage("Class initialization error: Constructor 'InterfaceToOpenClassImpl.<init>' should call a constructor of direct super class 'InterfaceToOpenClass' but calls 'Any.<init>' instead")) { getInterfaceToOpenClassImplAsAny() }
|
||||
expectFailure(linkage("Class initialization error: Constructor 'InterfaceToOpenClassImpl.<init>' should call a constructor of direct super class 'InterfaceToOpenClass' but calls 'Any.<init>' instead")) { getInterfaceToOpenClassImplAsAnyInline() }
|
||||
|
||||
expectFailure(linkage("Class initialization error: Constructor 'InterfaceToOpenClassImpl.<init>' should call a constructor of direct super class 'InterfaceToOpenClass' but calls 'Any.<init>' instead")) { getInterfaceToOpenClassImpl2() }
|
||||
expectFailure(linkage("Class initialization error: Constructor 'InterfaceToOpenClassImpl.<init>' should call a constructor of direct super class 'InterfaceToOpenClass' but calls 'Any.<init>' instead")) { getInterfaceToOpenClassImpl2Inline() }
|
||||
expectFailure(linkage("Class initialization error: Constructor 'InterfaceToOpenClassImpl.<init>' should call a constructor of direct super class 'InterfaceToOpenClass' but calls 'Any.<init>' instead")) { getInterfaceToOpenClassImpl2AsAny() }
|
||||
expectFailure(linkage("Class initialization error: Constructor 'InterfaceToOpenClassImpl.<init>' should call a constructor of direct super class 'InterfaceToOpenClass' but calls 'Any.<init>' instead")) { getInterfaceToOpenClassImpl2AsAnyInline() }
|
||||
|
||||
expectFailure(linkage("Function 'getInterfaceToFinalClassImpl' can not be called: Function uses class 'InterfaceToFinalClassImpl' that inherits from final class 'InterfaceToFinalClass'")) { getInterfaceToFinalClassImpl() }
|
||||
expectFailure(linkage("Function 'getInterfaceToFinalClassImplInline' can not be called: Function uses class 'InterfaceToFinalClassImpl' that inherits from final class 'InterfaceToFinalClass'")) { getInterfaceToFinalClassImplInline() }
|
||||
expectFailure(linkage("Constructor 'InterfaceToFinalClassImpl.<init>' can not be called: Class 'InterfaceToFinalClassImpl' inherits from final class 'InterfaceToFinalClass'")) { getInterfaceToFinalClassImplAsAny() }
|
||||
expectFailure(linkage("Constructor 'InterfaceToFinalClassImpl.<init>' can not be called: Class 'InterfaceToFinalClassImpl' inherits from final class 'InterfaceToFinalClass'")) { getInterfaceToFinalClassImplAsAnyInline() }
|
||||
|
||||
expectFailure(linkage("Function 'getInterfaceToFinalClassImpl2' can not be called: Function uses class 'InterfaceToFinalClassImpl' (via class 'InterfaceToFinalClassImpl2') that inherits from final class 'InterfaceToFinalClass'")) { getInterfaceToFinalClassImpl2() }
|
||||
expectFailure(linkage("Function 'getInterfaceToFinalClassImpl2Inline' can not be called: Function uses class 'InterfaceToFinalClassImpl' (via class 'InterfaceToFinalClassImpl2') that inherits from final class 'InterfaceToFinalClass'")) { getInterfaceToFinalClassImpl2Inline() }
|
||||
expectFailure(linkage("Constructor 'InterfaceToFinalClassImpl2.<init>' can not be called: Class 'InterfaceToFinalClassImpl2' uses class 'InterfaceToFinalClassImpl' that inherits from final class 'InterfaceToFinalClass'")) { getInterfaceToFinalClassImpl2AsAny() }
|
||||
expectFailure(linkage("Constructor 'InterfaceToFinalClassImpl2.<init>' can not be called: Class 'InterfaceToFinalClassImpl2' uses class 'InterfaceToFinalClassImpl' that inherits from final class 'InterfaceToFinalClass'")) { getInterfaceToFinalClassImpl2AsAnyInline() }
|
||||
|
||||
expectFailure(linkage("Class initialization error: Constructor 'InterfaceToAbstractClassImpl.<init>' should call a constructor of direct super class 'InterfaceToAbstractClass' but calls 'Any.<init>' instead")) { getInterfaceToAbstractClassNestedImpl() }
|
||||
expectFailure(linkage("Class initialization error: Constructor 'InterfaceToAbstractClassImpl.<init>' should call a constructor of direct super class 'InterfaceToAbstractClass' but calls 'Any.<init>' instead")) { getInterfaceToAbstractClassNestedImplInline() }
|
||||
expectFailure(linkage("Class initialization error: Constructor 'InterfaceToAbstractClassImpl.<init>' should call a constructor of direct super class 'InterfaceToAbstractClass' but calls 'Any.<init>' instead")) { getInterfaceToAbstractClassNestedImplAsAny() }
|
||||
expectFailure(linkage("Class initialization error: Constructor 'InterfaceToAbstractClassImpl.<init>' should call a constructor of direct super class 'InterfaceToAbstractClass' but calls 'Any.<init>' instead")) { getInterfaceToAbstractClassNestedImplAsAnyInline() }
|
||||
|
||||
expectFailure(linkage("Class initialization error: Constructor 'InterfaceToAbstractClassImpl.<init>' should call a constructor of direct super class 'InterfaceToAbstractClass' but calls 'Any.<init>' instead")) { getInterfaceToAbstractClassNestedImpl2() }
|
||||
expectFailure(linkage("Class initialization error: Constructor 'InterfaceToAbstractClassImpl.<init>' should call a constructor of direct super class 'InterfaceToAbstractClass' but calls 'Any.<init>' instead")) { getInterfaceToAbstractClassNestedImpl2Inline() }
|
||||
expectFailure(linkage("Class initialization error: Constructor 'InterfaceToAbstractClassImpl.<init>' should call a constructor of direct super class 'InterfaceToAbstractClass' but calls 'Any.<init>' instead")) { getInterfaceToAbstractClassNestedImpl2AsAny() }
|
||||
expectFailure(linkage("Class initialization error: Constructor 'InterfaceToAbstractClassImpl.<init>' should call a constructor of direct super class 'InterfaceToAbstractClass' but calls 'Any.<init>' instead")) { getInterfaceToAbstractClassNestedImpl2AsAnyInline() }
|
||||
|
||||
expectFailure(linkage("Inner class initialization error: Constructor 'InterfaceToAbstractClassInnerImpl.<init>' should call a constructor of direct super class 'InterfaceToAbstractClass' but calls 'Any.<init>' instead")) { getInterfaceToAbstractClassInnerImpl() }
|
||||
expectFailure(linkage("Inner class initialization error: Constructor 'InterfaceToAbstractClassInnerImpl.<init>' should call a constructor of direct super class 'InterfaceToAbstractClass' but calls 'Any.<init>' instead")) { getInterfaceToAbstractClassInnerImplInline() }
|
||||
expectFailure(linkage("Inner class initialization error: Constructor 'InterfaceToAbstractClassInnerImpl.<init>' should call a constructor of direct super class 'InterfaceToAbstractClass' but calls 'Any.<init>' instead")) { getInterfaceToAbstractClassInnerImplAsAny() }
|
||||
expectFailure(linkage("Inner class initialization error: Constructor 'InterfaceToAbstractClassInnerImpl.<init>' should call a constructor of direct super class 'InterfaceToAbstractClass' but calls 'Any.<init>' instead")) { getInterfaceToAbstractClassInnerImplAsAnyInline() }
|
||||
|
||||
expectFailure(linkage("Class initialization error: Constructor 'InterfaceToOpenClassImpl.<init>' should call a constructor of direct super class 'InterfaceToOpenClass' but calls 'Any.<init>' instead")) { getInterfaceToOpenClassNestedImpl() }
|
||||
expectFailure(linkage("Class initialization error: Constructor 'InterfaceToOpenClassImpl.<init>' should call a constructor of direct super class 'InterfaceToOpenClass' but calls 'Any.<init>' instead")) { getInterfaceToOpenClassNestedImplInline() }
|
||||
expectFailure(linkage("Class initialization error: Constructor 'InterfaceToOpenClassImpl.<init>' should call a constructor of direct super class 'InterfaceToOpenClass' but calls 'Any.<init>' instead")) { getInterfaceToOpenClassNestedImplAsAny() }
|
||||
expectFailure(linkage("Class initialization error: Constructor 'InterfaceToOpenClassImpl.<init>' should call a constructor of direct super class 'InterfaceToOpenClass' but calls 'Any.<init>' instead")) { getInterfaceToOpenClassNestedImplAsAnyInline() }
|
||||
|
||||
expectFailure(linkage("Class initialization error: Constructor 'InterfaceToOpenClassImpl.<init>' should call a constructor of direct super class 'InterfaceToOpenClass' but calls 'Any.<init>' instead")) { getInterfaceToOpenClassNestedImpl2() }
|
||||
expectFailure(linkage("Class initialization error: Constructor 'InterfaceToOpenClassImpl.<init>' should call a constructor of direct super class 'InterfaceToOpenClass' but calls 'Any.<init>' instead")) { getInterfaceToOpenClassNestedImpl2Inline() }
|
||||
expectFailure(linkage("Class initialization error: Constructor 'InterfaceToOpenClassImpl.<init>' should call a constructor of direct super class 'InterfaceToOpenClass' but calls 'Any.<init>' instead")) { getInterfaceToOpenClassNestedImpl2AsAny() }
|
||||
expectFailure(linkage("Class initialization error: Constructor 'InterfaceToOpenClassImpl.<init>' should call a constructor of direct super class 'InterfaceToOpenClass' but calls 'Any.<init>' instead")) { getInterfaceToOpenClassNestedImpl2AsAnyInline() }
|
||||
|
||||
expectFailure(linkage("Inner class initialization error: Constructor 'InterfaceToOpenClassInnerImpl.<init>' should call a constructor of direct super class 'InterfaceToOpenClass' but calls 'Any.<init>' instead")) { getInterfaceToOpenClassInnerImpl() }
|
||||
expectFailure(linkage("Inner class initialization error: Constructor 'InterfaceToOpenClassInnerImpl.<init>' should call a constructor of direct super class 'InterfaceToOpenClass' but calls 'Any.<init>' instead")) { getInterfaceToOpenClassInnerImplInline() }
|
||||
expectFailure(linkage("Inner class initialization error: Constructor 'InterfaceToOpenClassInnerImpl.<init>' should call a constructor of direct super class 'InterfaceToOpenClass' but calls 'Any.<init>' instead")) { getInterfaceToOpenClassInnerImplAsAny() }
|
||||
expectFailure(linkage("Inner class initialization error: Constructor 'InterfaceToOpenClassInnerImpl.<init>' should call a constructor of direct super class 'InterfaceToOpenClass' but calls 'Any.<init>' instead")) { getInterfaceToOpenClassInnerImplAsAnyInline() }
|
||||
|
||||
expectFailure(linkage("Function 'getInterfaceToFinalClassNestedImpl' can not be called: Function uses class 'InterfaceToFinalClassImpl' that inherits from final class 'InterfaceToFinalClass'")) { getInterfaceToFinalClassNestedImpl() }
|
||||
expectFailure(linkage("Function 'getInterfaceToFinalClassNestedImplInline' can not be called: Function uses class 'InterfaceToFinalClassImpl' that inherits from final class 'InterfaceToFinalClass'")) { getInterfaceToFinalClassNestedImplInline() }
|
||||
expectFailure(linkage("Constructor 'InterfaceToFinalClassImpl.<init>' can not be called: Class 'InterfaceToFinalClassImpl' inherits from final class 'InterfaceToFinalClass'")) { getInterfaceToFinalClassNestedImplAsAny() }
|
||||
expectFailure(linkage("Constructor 'InterfaceToFinalClassImpl.<init>' can not be called: Class 'InterfaceToFinalClassImpl' inherits from final class 'InterfaceToFinalClass'")) { getInterfaceToFinalClassNestedImplAsAnyInline() }
|
||||
|
||||
expectFailure(linkage("Function 'getInterfaceToFinalClassNestedImpl2' can not be called: Function uses class 'InterfaceToFinalClassImpl' (via class 'InterfaceToFinalClassImpl2') that inherits from final class 'InterfaceToFinalClass'")) { getInterfaceToFinalClassNestedImpl2() }
|
||||
expectFailure(linkage("Function 'getInterfaceToFinalClassNestedImpl2Inline' can not be called: Function uses class 'InterfaceToFinalClassImpl' (via class 'InterfaceToFinalClassImpl2') that inherits from final class 'InterfaceToFinalClass'")) { getInterfaceToFinalClassNestedImpl2Inline() }
|
||||
expectFailure(linkage("Constructor 'InterfaceToFinalClassImpl2.<init>' can not be called: Class 'InterfaceToFinalClassImpl2' uses class 'InterfaceToFinalClassImpl' that inherits from final class 'InterfaceToFinalClass'")) { getInterfaceToFinalClassNestedImpl2AsAny() }
|
||||
expectFailure(linkage("Constructor 'InterfaceToFinalClassImpl2.<init>' can not be called: Class 'InterfaceToFinalClassImpl2' uses class 'InterfaceToFinalClassImpl' that inherits from final class 'InterfaceToFinalClass'")) { getInterfaceToFinalClassNestedImpl2AsAnyInline() }
|
||||
|
||||
expectFailure(linkage("Function 'getInterfaceToFinalClassInnerImpl' can not be called: Function uses inner class 'InterfaceToFinalClassInnerImpl' that inherits from final class 'InterfaceToFinalClass'")) { getInterfaceToFinalClassInnerImpl() }
|
||||
expectFailure(linkage("Function 'getInterfaceToFinalClassInnerImplInline' can not be called: Function uses inner class 'InterfaceToFinalClassInnerImpl' that inherits from final class 'InterfaceToFinalClass'")) { getInterfaceToFinalClassInnerImplInline() }
|
||||
expectFailure(linkage("Constructor 'InterfaceToFinalClassInnerImpl.<init>' can not be called: Inner class 'InterfaceToFinalClassInnerImpl' inherits from final class 'InterfaceToFinalClass'")) { getInterfaceToFinalClassInnerImplAsAny() }
|
||||
expectFailure(linkage("Constructor 'InterfaceToFinalClassInnerImpl.<init>' can not be called: Inner class 'InterfaceToFinalClassInnerImpl' inherits from final class 'InterfaceToFinalClass'")) { getInterfaceToFinalClassInnerImplAsAnyInline() }
|
||||
|
||||
expectSuccess("InterfaceToAbstractClassImpl") { referenceToInterfaceToAbstractClassImpl() }
|
||||
expectSuccess("InterfaceToAbstractClassImpl") { referenceToInterfaceToAbstractClassImplInline() }
|
||||
expectSuccess("InterfaceToAbstractClassImpl2") { referenceToInterfaceToAbstractClassImpl2() }
|
||||
expectSuccess("InterfaceToAbstractClassImpl2") { referenceToInterfaceToAbstractClassImpl2Inline() }
|
||||
|
||||
expectFailure(linkage("Reference to class 'InterfaceToFinalClassImpl' can not be evaluated: Expression uses class 'InterfaceToFinalClassImpl' that inherits from final class 'InterfaceToFinalClass'")) { referenceToInterfaceToFinalClassImpl() }
|
||||
expectFailure(linkage("Reference to class 'InterfaceToFinalClassImpl' can not be evaluated: Expression uses class 'InterfaceToFinalClassImpl' that inherits from final class 'InterfaceToFinalClass'")) { referenceToInterfaceToFinalClassImplInline() }
|
||||
expectFailure(linkage("Reference to class 'InterfaceToFinalClassImpl2' can not be evaluated: Expression uses class 'InterfaceToFinalClassImpl' (via class 'InterfaceToFinalClassImpl2') that inherits from final class 'InterfaceToFinalClass'")) { referenceToInterfaceToFinalClassImpl2() }
|
||||
expectFailure(linkage("Reference to class 'InterfaceToFinalClassImpl2' can not be evaluated: Expression uses class 'InterfaceToFinalClassImpl' (via class 'InterfaceToFinalClassImpl2') that inherits from final class 'InterfaceToFinalClass'")) { referenceToInterfaceToFinalClassImpl2Inline() }
|
||||
|
||||
expectFailure(linkage("Function 'getInterfaceToAnnotationClassImpl' can not be called: Function uses class 'InterfaceToAnnotationClassImpl' that has illegal inheritance from annotation class 'InterfaceToAnnotationClass'")) { getInterfaceToAnnotationClassImpl() }
|
||||
expectFailure(linkage("Constructor 'InterfaceToAnnotationClassImpl.<init>' can not be called: Class 'InterfaceToAnnotationClassImpl' has illegal inheritance from annotation class 'InterfaceToAnnotationClass'")) { getInterfaceToAnnotationClassImplAsAny() }
|
||||
expectFailure(linkage("Function 'getInterfaceToObjectImpl' can not be called: Function uses class 'InterfaceToObjectImpl' that inherits from final object 'InterfaceToObject'")) { getInterfaceToObjectImpl() }
|
||||
expectFailure(linkage("Constructor 'InterfaceToObjectImpl.<init>' can not be called: Class 'InterfaceToObjectImpl' inherits from final object 'InterfaceToObject'")) { getInterfaceToObjectImplAsAny() }
|
||||
expectFailure(linkage("Function 'getInterfaceToEnumClassImpl' can not be called: Function uses class 'InterfaceToEnumClassImpl' that inherits from final enum class 'InterfaceToEnumClass'")) { getInterfaceToEnumClassImpl() }
|
||||
expectFailure(linkage("Constructor 'InterfaceToEnumClassImpl.<init>' can not be called: Class 'InterfaceToEnumClassImpl' inherits from final enum class 'InterfaceToEnumClass'")) { getInterfaceToEnumClassImplAsAny() }
|
||||
expectFailure(linkage("Function 'getInterfaceToValueClassImpl' can not be called: Function uses class 'InterfaceToValueClassImpl' that inherits from final value class 'InterfaceToValueClass'")) { getInterfaceToValueClassImpl() }
|
||||
expectFailure(linkage("Constructor 'InterfaceToValueClassImpl.<init>' can not be called: Class 'InterfaceToValueClassImpl' inherits from final value class 'InterfaceToValueClass'")) { getInterfaceToValueClassImplAny() }
|
||||
expectFailure(linkage("Function 'getInterfaceToDataClassImpl' can not be called: Function uses class 'InterfaceToDataClassImpl' that inherits from final data class 'InterfaceToDataClass'")) { getInterfaceToDataClassImpl() }
|
||||
expectFailure(linkage("Constructor 'InterfaceToDataClassImpl.<init>' can not be called: Class 'InterfaceToDataClassImpl' inherits from final data class 'InterfaceToDataClass'")) { getInterfaceToDataClassImplAny() }
|
||||
|
||||
expectFailure(linkage("Function 'getOpenClassToFinalClassImpl' can not be called: Function uses class 'OpenClassToFinalClassImpl' that inherits from final class 'OpenClassToFinalClass'")) { getOpenClassToFinalClassImpl() }
|
||||
expectFailure(linkage("Constructor 'OpenClassToFinalClassImpl.<init>' can not be called: Class 'OpenClassToFinalClassImpl' inherits from final class 'OpenClassToFinalClass'")) { getOpenClassToFinalClassImplAsAny() }
|
||||
expectFailure(linkage("Function 'getOpenClassToAnnotationClassImpl' can not be called: Function uses class 'OpenClassToAnnotationClassImpl' that has illegal inheritance from annotation class 'OpenClassToAnnotationClass'")) { getOpenClassToAnnotationClassImpl() }
|
||||
expectFailure(linkage("Constructor 'OpenClassToAnnotationClassImpl.<init>' can not be called: Class 'OpenClassToAnnotationClassImpl' has illegal inheritance from annotation class 'OpenClassToAnnotationClass'")) { getOpenClassToAnnotationClassImplAsAny() }
|
||||
expectFailure(linkage("Function 'getOpenClassToObjectImpl' can not be called: Function uses class 'OpenClassToObjectImpl' that inherits from final object 'OpenClassToObject'")) { getOpenClassToObjectImpl() }
|
||||
expectFailure(linkage("Constructor 'OpenClassToObjectImpl.<init>' can not be called: Class 'OpenClassToObjectImpl' inherits from final object 'OpenClassToObject'")) { getOpenClassToObjectImplAsAny() }
|
||||
expectFailure(linkage("Function 'getOpenClassToEnumClassImpl' can not be called: Function uses class 'OpenClassToEnumClassImpl' that inherits from final enum class 'OpenClassToEnumClass'")) { getOpenClassToEnumClassImpl() }
|
||||
expectFailure(linkage("Constructor 'OpenClassToEnumClassImpl.<init>' can not be called: Class 'OpenClassToEnumClassImpl' inherits from final enum class 'OpenClassToEnumClass'")) { getOpenClassToEnumClassImplAsAny() }
|
||||
expectFailure(linkage("Function 'getOpenClassToValueClassImpl' can not be called: Function uses class 'OpenClassToValueClassImpl' that inherits from final value class 'OpenClassToValueClass'")) { getOpenClassToValueClassImpl() }
|
||||
expectFailure(linkage("Constructor 'OpenClassToValueClassImpl.<init>' can not be called: Class 'OpenClassToValueClassImpl' inherits from final value class 'OpenClassToValueClass'")) { getOpenClassToValueClassImplAsAny() }
|
||||
expectFailure(linkage("Function 'getOpenClassToDataClassImpl' can not be called: Function uses class 'OpenClassToDataClassImpl' that inherits from final data class 'OpenClassToDataClass'")) { getOpenClassToDataClassImpl() }
|
||||
expectFailure(linkage("Constructor 'OpenClassToDataClassImpl.<init>' can not be called: Class 'OpenClassToDataClassImpl' inherits from final data class 'OpenClassToDataClass'")) { getOpenClassToDataClassImplAsAny() }
|
||||
expectFailure(linkage("Class initialization error: Constructor 'OpenClassToInterfaceImpl.<init>' should call a constructor of direct super class 'Any' but calls 'OpenClassToInterface.<init>' instead")) { getOpenClassToInterfaceImpl() }
|
||||
expectFailure(linkage("Class initialization error: Constructor 'OpenClassToInterfaceImpl.<init>' should call a constructor of direct super class 'Any' but calls 'OpenClassToInterface.<init>' instead")) { getOpenClassToInterfaceImplAsAny() }
|
||||
|
||||
expectFailure(linkage("Function 'getValueClassInheritsAbstractClass' can not be called: Function uses value class 'ValueClassInheritsAbstractClass' that has illegal inheritance from class 'InterfaceToAbstractClass'")) { getValueClassInheritsAbstractClass() }
|
||||
expectFailure(linkage("Constructor 'ValueClassInheritsAbstractClass.<init>' can not be called: Value class 'ValueClassInheritsAbstractClass' has illegal inheritance from class 'InterfaceToAbstractClass'")) { getValueClassInheritsAbstractClassAsAny() }
|
||||
expectFailure(linkage("Function 'getEnumClassInheritsAbstractClass' can not be called: Function uses enum class 'EnumClassInheritsAbstractClass' that simultaneously inherits from 2 classes: 'Enum', 'InterfaceToAbstractClass'")) { getEnumClassInheritsAbstractClass() }
|
||||
expectFailure(linkage("Can not get instance of singleton 'EnumClassInheritsAbstractClass.ENTRY': Expression uses enum class 'EnumClassInheritsAbstractClass' that simultaneously inherits from 2 classes: 'Enum', 'InterfaceToAbstractClass'")) { getEnumClassInheritsAbstractClassAsAny() }
|
||||
|
||||
expectFailure(linkage("Constructor '<init>' can not be called: Anonymous object simultaneously inherits from 2 classes: 'InterfaceToAbstractClass1', 'InterfaceToAbstractClass2'")) { getInterfaceToAbstractClass12_1() }
|
||||
expectFailure(linkage("Constructor '<init>' can not be called: Anonymous object simultaneously inherits from 2 classes: 'InterfaceToAbstractClass1', 'InterfaceToAbstractClass2'")) { getInterfaceToAbstractClass12_1Inline() }
|
||||
expectFailure(linkage("Constructor '<init>' can not be called: Anonymous object simultaneously inherits from 2 classes: 'InterfaceToAbstractClass1', 'InterfaceToAbstractClass2'")) { getInterfaceToAbstractClass12_2() }
|
||||
expectFailure(linkage("Constructor '<init>' can not be called: Anonymous object simultaneously inherits from 2 classes: 'InterfaceToAbstractClass1', 'InterfaceToAbstractClass2'")) { getInterfaceToAbstractClass12_2Inline() }
|
||||
expectFailure(linkage("Constructor '<init>' can not be called: Anonymous object simultaneously inherits from 2 classes: 'InterfaceToAbstractClass1', 'InterfaceToAbstractClass2'")) { getInterfaceToAbstractClass12AsAny() }
|
||||
expectFailure(linkage("Constructor '<init>' can not be called: Anonymous object simultaneously inherits from 2 classes: 'InterfaceToAbstractClass1', 'InterfaceToAbstractClass2'")) { getInterfaceToAbstractClass12AsAnyInline() }
|
||||
|
||||
expectFailure(linkage("Constructor '<init>' can not be called: Anonymous object simultaneously inherits from 2 classes: 'AbstractClass', 'InterfaceToAbstractClass1'")) { getInterfaceToAbstractClassAndAbstractClass_1() }
|
||||
expectFailure(linkage("Constructor '<init>' can not be called: Anonymous object simultaneously inherits from 2 classes: 'AbstractClass', 'InterfaceToAbstractClass1'")) { getInterfaceToAbstractClassAndAbstractClass_1Inline() }
|
||||
expectFailure(linkage("Constructor '<init>' can not be called: Anonymous object simultaneously inherits from 2 classes: 'AbstractClass', 'InterfaceToAbstractClass1'")) { getInterfaceToAbstractClassAndAbstractClass_2() }
|
||||
expectFailure(linkage("Constructor '<init>' can not be called: Anonymous object simultaneously inherits from 2 classes: 'AbstractClass', 'InterfaceToAbstractClass1'")) { getInterfaceToAbstractClassAndAbstractClass_2Inline() }
|
||||
expectFailure(linkage("Constructor '<init>' can not be called: Anonymous object simultaneously inherits from 2 classes: 'AbstractClass', 'InterfaceToAbstractClass1'")) { getInterfaceToAbstractClassAndAbstractClassAsAny() }
|
||||
expectFailure(linkage("Constructor '<init>' can not be called: Anonymous object simultaneously inherits from 2 classes: 'AbstractClass', 'InterfaceToAbstractClass1'")) { getInterfaceToAbstractClassAndAbstractClassAsAnyInline() }
|
||||
|
||||
expectFailure(linkage("Function 'getInterfaceToAbstractClass12Impl' can not be called: Function uses class 'InterfaceToAbstractClass12Impl' that simultaneously inherits from 2 classes: 'InterfaceToAbstractClass1', 'InterfaceToAbstractClass2'")) { getInterfaceToAbstractClass12Impl() }
|
||||
expectFailure(linkage("Function 'getInterfaceToAbstractClass12ImplInline' can not be called: Function uses class 'InterfaceToAbstractClass12Impl' that simultaneously inherits from 2 classes: 'InterfaceToAbstractClass1', 'InterfaceToAbstractClass2'")) { getInterfaceToAbstractClass12ImplInline() }
|
||||
expectFailure(linkage("Constructor 'InterfaceToAbstractClass12Impl.<init>' can not be called: Class 'InterfaceToAbstractClass12Impl' simultaneously inherits from 2 classes: 'InterfaceToAbstractClass1', 'InterfaceToAbstractClass2'")) { getInterfaceToAbstractClass12ImplAsAny() }
|
||||
expectFailure(linkage("Constructor 'InterfaceToAbstractClass12Impl.<init>' can not be called: Class 'InterfaceToAbstractClass12Impl' simultaneously inherits from 2 classes: 'InterfaceToAbstractClass1', 'InterfaceToAbstractClass2'")) { getInterfaceToAbstractClass12ImplAsAnyInline() }
|
||||
|
||||
expectFailure(linkage("Function 'getInterfaceToAbstractClass12Impl2' can not be called: Function uses class 'InterfaceToAbstractClass12Impl' (via class 'InterfaceToAbstractClass12Impl2') that simultaneously inherits from 2 classes: 'InterfaceToAbstractClass1', 'InterfaceToAbstractClass2'")) { getInterfaceToAbstractClass12Impl2() }
|
||||
expectFailure(linkage("Function 'getInterfaceToAbstractClass12Impl2Inline' can not be called: Function uses class 'InterfaceToAbstractClass12Impl' (via class 'InterfaceToAbstractClass12Impl2') that simultaneously inherits from 2 classes: 'InterfaceToAbstractClass1', 'InterfaceToAbstractClass2'")) { getInterfaceToAbstractClass12Impl2Inline() }
|
||||
expectFailure(linkage("Constructor 'InterfaceToAbstractClass12Impl2.<init>' can not be called: Class 'InterfaceToAbstractClass12Impl2' uses class 'InterfaceToAbstractClass12Impl' that simultaneously inherits from 2 classes: 'InterfaceToAbstractClass1', 'InterfaceToAbstractClass2'")) { getInterfaceToAbstractClass12Impl2AsAny() }
|
||||
expectFailure(linkage("Constructor 'InterfaceToAbstractClass12Impl2.<init>' can not be called: Class 'InterfaceToAbstractClass12Impl2' uses class 'InterfaceToAbstractClass12Impl' that simultaneously inherits from 2 classes: 'InterfaceToAbstractClass1', 'InterfaceToAbstractClass2'")) { getInterfaceToAbstractClass12Impl2AsAnyInline() }
|
||||
|
||||
expectFailure(linkage("Function 'getInterfaceToAbstractClassAndAbstractClassImpl' can not be called: Function uses class 'InterfaceToAbstractClassAndAbstractClassImpl' that simultaneously inherits from 2 classes: 'AbstractClass', 'InterfaceToAbstractClass1'")) { getInterfaceToAbstractClassAndAbstractClassImpl() }
|
||||
expectFailure(linkage("Function 'getInterfaceToAbstractClassAndAbstractClassImplInline' can not be called: Function uses class 'InterfaceToAbstractClassAndAbstractClassImpl' that simultaneously inherits from 2 classes: 'AbstractClass', 'InterfaceToAbstractClass1'")) { getInterfaceToAbstractClassAndAbstractClassImplInline() }
|
||||
expectFailure(linkage("Constructor 'InterfaceToAbstractClassAndAbstractClassImpl.<init>' can not be called: Class 'InterfaceToAbstractClassAndAbstractClassImpl' simultaneously inherits from 2 classes: 'AbstractClass', 'InterfaceToAbstractClass1'")) { getInterfaceToAbstractClassAndAbstractClassImplAsAny() }
|
||||
expectFailure(linkage("Constructor 'InterfaceToAbstractClassAndAbstractClassImpl.<init>' can not be called: Class 'InterfaceToAbstractClassAndAbstractClassImpl' simultaneously inherits from 2 classes: 'AbstractClass', 'InterfaceToAbstractClass1'")) { getInterfaceToAbstractClassAndAbstractClassImplAsAnyInline() }
|
||||
|
||||
expectFailure(linkage("Function 'getInterfaceToAbstractClassAndAbstractClassImpl2' can not be called: Function uses class 'InterfaceToAbstractClassAndAbstractClassImpl' (via class 'InterfaceToAbstractClassAndAbstractClassImpl2') that simultaneously inherits from 2 classes: 'AbstractClass', 'InterfaceToAbstractClass1'")) { getInterfaceToAbstractClassAndAbstractClassImpl2() }
|
||||
expectFailure(linkage("Function 'getInterfaceToAbstractClassAndAbstractClassImpl2Inline' can not be called: Function uses class 'InterfaceToAbstractClassAndAbstractClassImpl' (via class 'InterfaceToAbstractClassAndAbstractClassImpl2') that simultaneously inherits from 2 classes: 'AbstractClass', 'InterfaceToAbstractClass1'")) { getInterfaceToAbstractClassAndAbstractClassImpl2Inline() }
|
||||
expectFailure(linkage("Constructor 'InterfaceToAbstractClassAndAbstractClassImpl2.<init>' can not be called: Class 'InterfaceToAbstractClassAndAbstractClassImpl2' uses class 'InterfaceToAbstractClassAndAbstractClassImpl' that simultaneously inherits from 2 classes: 'AbstractClass', 'InterfaceToAbstractClass1'")) { getInterfaceToAbstractClassAndAbstractClassImpl2AsAny() }
|
||||
expectFailure(linkage("Constructor 'InterfaceToAbstractClassAndAbstractClassImpl2.<init>' can not be called: Class 'InterfaceToAbstractClassAndAbstractClassImpl2' uses class 'InterfaceToAbstractClassAndAbstractClassImpl' that simultaneously inherits from 2 classes: 'AbstractClass', 'InterfaceToAbstractClass1'")) { getInterfaceToAbstractClassAndAbstractClassImpl2AsAnyInline() }
|
||||
|
||||
expectFailure(linkage("Reference to class 'InterfaceToAbstractClass12Impl' can not be evaluated: Expression uses class 'InterfaceToAbstractClass12Impl' that simultaneously inherits from 2 classes: 'InterfaceToAbstractClass1', 'InterfaceToAbstractClass2'")) { referenceToInterfaceToAbstractClass12Impl() }
|
||||
expectFailure(linkage("Reference to class 'InterfaceToAbstractClass12Impl' can not be evaluated: Expression uses class 'InterfaceToAbstractClass12Impl' that simultaneously inherits from 2 classes: 'InterfaceToAbstractClass1', 'InterfaceToAbstractClass2'")) { referenceToInterfaceToAbstractClass12ImplInline() }
|
||||
expectFailure(linkage("Reference to class 'InterfaceToAbstractClass12Impl2' can not be evaluated: Expression uses class 'InterfaceToAbstractClass12Impl' (via class 'InterfaceToAbstractClass12Impl2') that simultaneously inherits from 2 classes: 'InterfaceToAbstractClass1', 'InterfaceToAbstractClass2'")) { referenceToInterfaceToAbstractClass12Impl2Impl() }
|
||||
expectFailure(linkage("Reference to class 'InterfaceToAbstractClass12Impl2' can not be evaluated: Expression uses class 'InterfaceToAbstractClass12Impl' (via class 'InterfaceToAbstractClass12Impl2') that simultaneously inherits from 2 classes: 'InterfaceToAbstractClass1', 'InterfaceToAbstractClass2'")) { referenceToInterfaceToAbstractClass12Impl2Inline() }
|
||||
expectFailure(linkage("Reference to class 'InterfaceToAbstractClassAndAbstractClassImpl' can not be evaluated: Expression uses class 'InterfaceToAbstractClassAndAbstractClassImpl' that simultaneously inherits from 2 classes: 'AbstractClass', 'InterfaceToAbstractClass1'")) { referenceToInterfaceToAbstractClassAndAbstractClassImpl() }
|
||||
expectFailure(linkage("Reference to class 'InterfaceToAbstractClassAndAbstractClassImpl' can not be evaluated: Expression uses class 'InterfaceToAbstractClassAndAbstractClassImpl' that simultaneously inherits from 2 classes: 'AbstractClass', 'InterfaceToAbstractClass1'")) { referenceToInterfaceToAbstractClassAndAbstractClassImplInline() }
|
||||
expectFailure(linkage("Reference to class 'InterfaceToAbstractClassAndAbstractClassImpl2' can not be evaluated: Expression uses class 'InterfaceToAbstractClassAndAbstractClassImpl' (via class 'InterfaceToAbstractClassAndAbstractClassImpl2') that simultaneously inherits from 2 classes: 'AbstractClass', 'InterfaceToAbstractClass1'")) { referenceToInterfaceToAbstractClassAndAbstractClassImpl2Impl() }
|
||||
expectFailure(linkage("Reference to class 'InterfaceToAbstractClassAndAbstractClassImpl2' can not be evaluated: Expression uses class 'InterfaceToAbstractClassAndAbstractClassImpl' (via class 'InterfaceToAbstractClassAndAbstractClassImpl2') that simultaneously inherits from 2 classes: 'AbstractClass', 'InterfaceToAbstractClass1'")) { referenceToInterfaceToAbstractClassAndAbstractClassImpl2Inline() }
|
||||
|
||||
expectFailure(linkage("Can not read value from variable 'removedInterfaceImpl1': Variable uses unlinked class symbol '/RemovedInterface' (via class 'RemovedInterfaceImpl1')")) { removedInterfaceImpl1.abstractFun() }
|
||||
expectFailure(linkage("Can not read value from variable 'removedInterfaceImpl1': Variable uses unlinked class symbol '/RemovedInterface' (via class 'RemovedInterfaceImpl1')")) { removedInterfaceImpl1.abstractFunWithDefaultImpl() }
|
||||
expectFailure(linkage("Can not read value from variable 'removedInterfaceImpl1': Variable uses unlinked class symbol '/RemovedInterface' (via class 'RemovedInterfaceImpl1')")) { removedInterfaceImpl1.abstractVal }
|
||||
expectFailure(linkage("Can not read value from variable 'removedInterfaceImpl1': Variable uses unlinked class symbol '/RemovedInterface' (via class 'RemovedInterfaceImpl1')")) { removedInterfaceImpl1.abstractValWithDefaultImpl }
|
||||
|
||||
expectFailure(linkage("Can not read value from variable 'removedInterfaceImpl2': Variable uses unlinked class symbol '/RemovedInterface' (via class 'RemovedInterfaceImpl2')")) { removedInterfaceImpl2.abstractFun() }
|
||||
expectFailure(linkage("Can not read value from variable 'removedInterfaceImpl2': Variable uses unlinked class symbol '/RemovedInterface' (via class 'RemovedInterfaceImpl2')")) { removedInterfaceImpl2.abstractFunWithDefaultImpl() }
|
||||
expectFailure(linkage("Can not read value from variable 'removedInterfaceImpl2': Variable uses unlinked class symbol '/RemovedInterface' (via class 'RemovedInterfaceImpl2')")) { removedInterfaceImpl2.abstractVal }
|
||||
expectFailure(linkage("Can not read value from variable 'removedInterfaceImpl2': Variable uses unlinked class symbol '/RemovedInterface' (via class 'RemovedInterfaceImpl2')")) { removedInterfaceImpl2.abstractValWithDefaultImpl }
|
||||
|
||||
expectFailure(linkage("Can not read value from variable 'removedAbstractClassImpl1': Variable uses unlinked class symbol '/RemovedAbstractClass' (via class 'RemovedAbstractClassImpl1')")) { removedAbstractClassImpl1.abstractFun() }
|
||||
expectFailure(linkage("Can not read value from variable 'removedAbstractClassImpl1': Variable uses unlinked class symbol '/RemovedAbstractClass' (via class 'RemovedAbstractClassImpl1')")) { removedAbstractClassImpl1.openFun() }
|
||||
expectFailure(linkage("Can not read value from variable 'removedAbstractClassImpl1': Variable uses unlinked class symbol '/RemovedAbstractClass' (via class 'RemovedAbstractClassImpl1')")) { removedAbstractClassImpl1.finalFun() }
|
||||
expectFailure(linkage("Can not read value from variable 'removedAbstractClassImpl1': Variable uses unlinked class symbol '/RemovedAbstractClass' (via class 'RemovedAbstractClassImpl1')")) { removedAbstractClassImpl1.abstractVal }
|
||||
expectFailure(linkage("Can not read value from variable 'removedAbstractClassImpl1': Variable uses unlinked class symbol '/RemovedAbstractClass' (via class 'RemovedAbstractClassImpl1')")) { removedAbstractClassImpl1.openVal }
|
||||
expectFailure(linkage("Can not read value from variable 'removedAbstractClassImpl1': Variable uses unlinked class symbol '/RemovedAbstractClass' (via class 'RemovedAbstractClassImpl1')")) { removedAbstractClassImpl1.finalVal }
|
||||
|
||||
expectFailure(linkage("Can not read value from variable 'removedAbstractClassImpl2': Variable uses unlinked class symbol '/RemovedAbstractClass' (via class 'RemovedAbstractClassImpl2')")) { removedAbstractClassImpl2.abstractFun() }
|
||||
expectFailure(linkage("Can not read value from variable 'removedAbstractClassImpl2': Variable uses unlinked class symbol '/RemovedAbstractClass' (via class 'RemovedAbstractClassImpl2')")) { removedAbstractClassImpl2.openFun() }
|
||||
expectFailure(linkage("Can not read value from variable 'removedAbstractClassImpl2': Variable uses unlinked class symbol '/RemovedAbstractClass' (via class 'RemovedAbstractClassImpl2')")) { removedAbstractClassImpl2.finalFun() }
|
||||
expectFailure(linkage("Can not read value from variable 'removedAbstractClassImpl2': Variable uses unlinked class symbol '/RemovedAbstractClass' (via class 'RemovedAbstractClassImpl2')")) { removedAbstractClassImpl2.abstractVal }
|
||||
expectFailure(linkage("Can not read value from variable 'removedAbstractClassImpl2': Variable uses unlinked class symbol '/RemovedAbstractClass' (via class 'RemovedAbstractClassImpl2')")) { removedAbstractClassImpl2.openVal }
|
||||
expectFailure(linkage("Can not read value from variable 'removedAbstractClassImpl2': Variable uses unlinked class symbol '/RemovedAbstractClass' (via class 'RemovedAbstractClassImpl2')")) { removedAbstractClassImpl2.finalVal }
|
||||
|
||||
expectFailure(linkage("Can not read value from variable 'removedOpenClassImpl1': Variable uses unlinked class symbol '/RemovedOpenClass' (via class 'RemovedOpenClassImpl1')")) { removedOpenClassImpl1.openFun() }
|
||||
expectFailure(linkage("Can not read value from variable 'removedOpenClassImpl1': Variable uses unlinked class symbol '/RemovedOpenClass' (via class 'RemovedOpenClassImpl1')")) { removedOpenClassImpl1.finalFun() }
|
||||
expectFailure(linkage("Can not read value from variable 'removedOpenClassImpl1': Variable uses unlinked class symbol '/RemovedOpenClass' (via class 'RemovedOpenClassImpl1')")) { removedOpenClassImpl1.openVal }
|
||||
expectFailure(linkage("Can not read value from variable 'removedOpenClassImpl1': Variable uses unlinked class symbol '/RemovedOpenClass' (via class 'RemovedOpenClassImpl1')")) { removedOpenClassImpl1.finalVal }
|
||||
|
||||
expectFailure(linkage("Can not read value from variable 'removedOpenClassImpl2': Variable uses unlinked class symbol '/RemovedOpenClass' (via class 'RemovedOpenClassImpl2')")) { removedOpenClassImpl2.openFun() }
|
||||
expectFailure(linkage("Can not read value from variable 'removedOpenClassImpl2': Variable uses unlinked class symbol '/RemovedOpenClass' (via class 'RemovedOpenClassImpl2')")) { removedOpenClassImpl2.finalFun() }
|
||||
expectFailure(linkage("Can not read value from variable 'removedOpenClassImpl2': Variable uses unlinked class symbol '/RemovedOpenClass' (via class 'RemovedOpenClassImpl2')")) { removedOpenClassImpl2.openVal }
|
||||
expectFailure(linkage("Can not read value from variable 'removedOpenClassImpl2': Variable uses unlinked class symbol '/RemovedOpenClass' (via class 'RemovedOpenClassImpl2')")) { removedOpenClassImpl2.finalVal }
|
||||
|
||||
expectFailure(linkage("Constructor 'AbstractClassWithChangedConstructorSignature.<init>' can not be called: No constructor found for symbol '/AbstractClassWithChangedConstructorSignature.<init>'")) { AbstractClassWithChangedConstructorSignatureImpl() }
|
||||
expectFailure(linkage("Constructor 'OpenClassWithChangedConstructorSignature.<init>' can not be called: No constructor found for symbol '/OpenClassWithChangedConstructorSignature.<init>'")) { OpenClassWithChangedConstructorSignatureImpl() }
|
||||
|
||||
expectSuccess("SuperSuperClassReplacedBySuperClass -> SuperClass -> SuperSuperClass -> Any") { superSuperClassReplacedBySuperClass.inheritsFrom() }
|
||||
expectSuccess(true) { SuperSuperClass::class.isInstance(superSuperClassReplacedBySuperClass) } // This check is done during the runtime.
|
||||
expectSuccess(true) { SuperClass::class.isInstance(superSuperClassReplacedBySuperClass) } // This check is done during the runtime.
|
||||
|
||||
expectSuccess("SuperClassReplacedBySuperSuperClass -> SuperSuperClass -> Any") { superClassReplacedBySuperSuperClass.inheritsFrom() }
|
||||
expectSuccess(true) { SuperSuperClass::class.isInstance(superClassReplacedBySuperSuperClass) } // This check is done during the runtime.
|
||||
expectSuccess(false) { SuperClass::class.isInstance(superClassReplacedBySuperSuperClass) } // This check is done during the runtime.
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package lib1
|
||||
|
||||
abstract class AbstractClassWithFunctions {
|
||||
fun foo(): Int = 42
|
||||
open fun bar(): Int = 42
|
||||
open fun baz(): Int = 42
|
||||
}
|
||||
|
||||
interface InterfaceWithFunctions {
|
||||
fun foo(): Int = 42
|
||||
fun bar(): Int = 42
|
||||
}
|
||||
|
||||
abstract class AbstractClassWithProperties {
|
||||
val foo1: Int = 42
|
||||
val foo2: Int get() = 42
|
||||
open val bar1: Int = 42
|
||||
open val bar2: Int get() = 42
|
||||
open val baz1: Int = 42
|
||||
open val baz2: Int get() = 42
|
||||
}
|
||||
|
||||
interface InterfaceWithProperties {
|
||||
val foo: Int get() = 42
|
||||
val bar: Int get() = 42
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package lib1
|
||||
|
||||
abstract class AbstractClassWithFunctions {
|
||||
abstract fun foo(): Int
|
||||
abstract fun bar(): Int
|
||||
abstract fun baz(): Int
|
||||
}
|
||||
|
||||
interface InterfaceWithFunctions {
|
||||
fun foo(): Int
|
||||
fun bar(): Int
|
||||
}
|
||||
|
||||
abstract class AbstractClassWithProperties {
|
||||
abstract val foo1: Int
|
||||
abstract val foo2: Int
|
||||
abstract val bar1: Int
|
||||
abstract val bar2: Int
|
||||
abstract val baz1: Int
|
||||
abstract val baz2: Int
|
||||
}
|
||||
|
||||
interface InterfaceWithProperties {
|
||||
val foo: Int
|
||||
val bar: Int
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package lib2
|
||||
|
||||
import lib1.*
|
||||
|
||||
class AbstractClassWithFunctionsImpl1 : AbstractClassWithFunctions() {
|
||||
override fun baz() = -42
|
||||
val unlinkedFunctionUsage get() = foo() + bar()
|
||||
}
|
||||
|
||||
class AbstractClassWithFunctionsImpl2 : AbstractClassWithFunctions() {
|
||||
override fun baz() = -42
|
||||
val unlinkedFunctionUsage = foo() // Expected failure on class instance initialization.
|
||||
}
|
||||
|
||||
class AbstractClassWithFunctionsImpl3 : AbstractClassWithFunctions() {
|
||||
override fun baz() = -42
|
||||
val unlinkedFunctionUsage = bar() // Expected failure on class instance initialization.
|
||||
}
|
||||
|
||||
class InterfaceWithFunctionsImpl1 : InterfaceWithFunctions {
|
||||
override fun bar() = -42
|
||||
val unlinkedFunctionUsage get() = foo()
|
||||
}
|
||||
|
||||
class InterfaceWithFunctionsImpl2 : InterfaceWithFunctions {
|
||||
override fun bar() = -42
|
||||
val unlinkedFunctionUsage = foo() // Expected failure on class instance initialization.
|
||||
}
|
||||
|
||||
class AbstractClassWithPropertiesImpl1 : AbstractClassWithProperties() {
|
||||
override val baz1 = -42
|
||||
override val baz2 get() = -42
|
||||
val unlinkedPropertyUsage get() = foo1 + foo2 + bar1 + bar2
|
||||
}
|
||||
|
||||
class AbstractClassWithPropertiesImpl2 : AbstractClassWithProperties() {
|
||||
override val baz1 = -42
|
||||
override val baz2 get() = -42
|
||||
val unlinkedPropertyUsage = foo1
|
||||
}
|
||||
|
||||
class AbstractClassWithPropertiesImpl3 : AbstractClassWithProperties() {
|
||||
override val baz1 = -42
|
||||
override val baz2 get() = -42
|
||||
val unlinkedPropertyUsage = foo2
|
||||
}
|
||||
|
||||
class AbstractClassWithPropertiesImpl4 : AbstractClassWithProperties() {
|
||||
override val baz1 = -42
|
||||
override val baz2 get() = -42
|
||||
val unlinkedPropertyUsage = bar1
|
||||
}
|
||||
|
||||
class AbstractClassWithPropertiesImpl5 : AbstractClassWithProperties() {
|
||||
override val baz1 = -42
|
||||
override val baz2 get() = -42
|
||||
val unlinkedPropertyUsage = bar2
|
||||
}
|
||||
|
||||
class InterfaceWithPropertiesImpl1 : InterfaceWithProperties {
|
||||
override val bar get() = -42
|
||||
val unlinkedPropertyUsage get() = foo
|
||||
}
|
||||
|
||||
class InterfaceWithPropertiesImpl2 : InterfaceWithProperties {
|
||||
override val bar get() = -42
|
||||
val unlinkedPropertyUsage = foo
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
import abitestutils.abiTest
|
||||
import lib1.*
|
||||
import lib2.*
|
||||
|
||||
fun box() = abiTest {
|
||||
val abstractClassWithFunctions: AbstractClassWithFunctions = AbstractClassWithFunctionsImpl1()
|
||||
val abstractClassWithFunctionsImpl1 = AbstractClassWithFunctionsImpl1()
|
||||
val interfaceWithFunctions: InterfaceWithFunctions = InterfaceWithFunctionsImpl1()
|
||||
val interfaceWithFunctionsImpl1 = InterfaceWithFunctionsImpl1()
|
||||
val abstractClassWithProperties: AbstractClassWithProperties = AbstractClassWithPropertiesImpl1()
|
||||
val abstractClassWithPropertiesImpl1 = AbstractClassWithPropertiesImpl1()
|
||||
val interfaceWithProperties: InterfaceWithProperties = InterfaceWithPropertiesImpl1()
|
||||
val interfaceWithPropertiesImpl1 = InterfaceWithPropertiesImpl1()
|
||||
|
||||
expectFailure(nonImplementedCallable("function 'foo'", "class 'AbstractClassWithFunctionsImpl1'")) { abstractClassWithFunctions.foo() }
|
||||
expectFailure(nonImplementedCallable("function 'bar'", "class 'AbstractClassWithFunctionsImpl1'")) { abstractClassWithFunctions.bar() }
|
||||
expectSuccess(-42) { abstractClassWithFunctions.baz() }
|
||||
expectFailure(nonImplementedCallable("function 'foo'", "class 'AbstractClassWithFunctionsImpl1'")) { abstractClassWithFunctionsImpl1.unlinkedFunctionUsage }
|
||||
expectFailure(nonImplementedCallable("function 'foo'", "class 'AbstractClassWithFunctionsImpl2'")) { AbstractClassWithFunctionsImpl2() }
|
||||
expectFailure(nonImplementedCallable("function 'bar'", "class 'AbstractClassWithFunctionsImpl3'")) { AbstractClassWithFunctionsImpl3() }
|
||||
|
||||
expectFailure(nonImplementedCallable("function 'foo'", "class 'InterfaceWithFunctionsImpl1'")) { interfaceWithFunctions.foo() }
|
||||
expectSuccess(-42) { interfaceWithFunctions.bar() }
|
||||
expectFailure(nonImplementedCallable("function 'foo'", "class 'InterfaceWithFunctionsImpl1'")) { interfaceWithFunctionsImpl1.unlinkedFunctionUsage }
|
||||
expectFailure(nonImplementedCallable("function 'foo'", "class 'InterfaceWithFunctionsImpl2'")) { InterfaceWithFunctionsImpl2() }
|
||||
|
||||
expectFailure(nonImplementedCallable("property accessor 'foo1.<get-foo1>'", "class 'AbstractClassWithPropertiesImpl1'")) { abstractClassWithProperties.foo1 }
|
||||
expectFailure(nonImplementedCallable("property accessor 'foo2.<get-foo2>'", "class 'AbstractClassWithPropertiesImpl1'")) { abstractClassWithProperties.foo2 }
|
||||
expectFailure(nonImplementedCallable("property accessor 'bar1.<get-bar1>'", "class 'AbstractClassWithPropertiesImpl1'")) { abstractClassWithProperties.bar1 }
|
||||
expectFailure(nonImplementedCallable("property accessor 'bar2.<get-bar2>'", "class 'AbstractClassWithPropertiesImpl1'")) { abstractClassWithProperties.bar2 }
|
||||
expectSuccess(-42) { abstractClassWithProperties.baz1 }
|
||||
expectSuccess(-42) { abstractClassWithProperties.baz2 }
|
||||
expectFailure(nonImplementedCallable("property accessor 'foo1.<get-foo1>'", "class 'AbstractClassWithPropertiesImpl1'")) { abstractClassWithPropertiesImpl1.unlinkedPropertyUsage }
|
||||
expectFailure(nonImplementedCallable("property accessor 'foo1.<get-foo1>'", "class 'AbstractClassWithPropertiesImpl2'")) { AbstractClassWithPropertiesImpl2() }
|
||||
expectFailure(nonImplementedCallable("property accessor 'foo2.<get-foo2>'", "class 'AbstractClassWithPropertiesImpl3'")) { AbstractClassWithPropertiesImpl3() }
|
||||
expectFailure(nonImplementedCallable("property accessor 'bar1.<get-bar1>'", "class 'AbstractClassWithPropertiesImpl4'")) { AbstractClassWithPropertiesImpl4() }
|
||||
expectFailure(nonImplementedCallable("property accessor 'bar2.<get-bar2>'", "class 'AbstractClassWithPropertiesImpl5'")) { AbstractClassWithPropertiesImpl5() }
|
||||
|
||||
expectFailure(nonImplementedCallable("property accessor 'foo.<get-foo>'", "class 'InterfaceWithPropertiesImpl1'")) { interfaceWithProperties.foo }
|
||||
expectSuccess(-42) { interfaceWithProperties.bar }
|
||||
expectFailure(nonImplementedCallable("property accessor 'foo.<get-foo>'", "class 'InterfaceWithPropertiesImpl1'")) { interfaceWithPropertiesImpl1.unlinkedPropertyUsage }
|
||||
expectFailure(nonImplementedCallable("property accessor 'foo.<get-foo>'", "class 'InterfaceWithPropertiesImpl2'")) { InterfaceWithPropertiesImpl2() }
|
||||
}
|
||||
-7
@@ -1,7 +0,0 @@
|
||||
package lib1
|
||||
|
||||
abstract class A {
|
||||
fun foo(): Int = 42
|
||||
open fun bar(): Int = 42
|
||||
open fun baz(): Int = 42
|
||||
}
|
||||
-7
@@ -1,7 +0,0 @@
|
||||
package lib1
|
||||
|
||||
abstract class A {
|
||||
abstract fun foo(): Int
|
||||
abstract fun bar(): Int
|
||||
abstract fun baz(): Int
|
||||
}
|
||||
-21
@@ -1,21 +0,0 @@
|
||||
package lib2
|
||||
|
||||
import lib1.A
|
||||
|
||||
class B : A() {
|
||||
override fun baz() = -42
|
||||
|
||||
val unlinkedFunctionUsage get() = foo() + bar()
|
||||
}
|
||||
|
||||
class B1 : A() {
|
||||
override fun baz() = -42
|
||||
|
||||
val unlinkedFunctionUsage = foo() // Expected failure on class instance initialization.
|
||||
}
|
||||
|
||||
class B2 : A() {
|
||||
override fun baz() = -42
|
||||
|
||||
val unlinkedFunctionUsage = bar() // Expected failure on class instance initialization.
|
||||
}
|
||||
-16
@@ -1,16 +0,0 @@
|
||||
import abitestutils.abiTest
|
||||
import lib1.A
|
||||
import lib2.B
|
||||
import lib2.B1
|
||||
import lib2.B2
|
||||
|
||||
fun box() = abiTest {
|
||||
val a: A = B()
|
||||
val b = B()
|
||||
expectFailure(nonImplementedCallable("function foo", "class B")) { a.foo() }
|
||||
expectFailure(nonImplementedCallable("function bar", "class B")) { a.bar() }
|
||||
expectSuccess(-42) { a.baz() }
|
||||
expectFailure(nonImplementedCallable("function foo", "class B")) { b.unlinkedFunctionUsage }
|
||||
expectFailure(nonImplementedCallable("function foo", "class B1")) { B1() }
|
||||
expectFailure(nonImplementedCallable("function bar", "class B2")) { B2() }
|
||||
}
|
||||
-6
@@ -1,6 +0,0 @@
|
||||
package lib1
|
||||
|
||||
interface A {
|
||||
fun foo(): Int = 42
|
||||
fun bar(): Int = 42
|
||||
}
|
||||
-6
@@ -1,6 +0,0 @@
|
||||
package lib1
|
||||
|
||||
interface A {
|
||||
fun foo(): Int
|
||||
fun bar(): Int
|
||||
}
|
||||
-15
@@ -1,15 +0,0 @@
|
||||
package lib2
|
||||
|
||||
import lib1.A
|
||||
|
||||
class B : A {
|
||||
override fun bar() = -42
|
||||
|
||||
val unlinkedFunctionUsage get() = foo()
|
||||
}
|
||||
|
||||
class B1 : A {
|
||||
override fun bar() = -42
|
||||
|
||||
val unlinkedFunctionUsage = foo() // Expected failure on class instance initialization.
|
||||
}
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
import abitestutils.abiTest
|
||||
import lib1.A
|
||||
import lib2.B
|
||||
import lib2.B1
|
||||
|
||||
fun box() = abiTest {
|
||||
val a: A = B()
|
||||
val b = B()
|
||||
expectFailure(nonImplementedCallable("function foo", "class B")) { a.foo() }
|
||||
expectSuccess(-42) { a.bar() }
|
||||
expectFailure(nonImplementedCallable("function foo", "class B")) { b.unlinkedFunctionUsage }
|
||||
expectFailure(nonImplementedCallable("function foo", "class B1")) { B1() }
|
||||
}
|
||||
-10
@@ -1,10 +0,0 @@
|
||||
package lib1
|
||||
|
||||
abstract class A {
|
||||
val foo1: Int = 42
|
||||
val foo2: Int get() = 42
|
||||
open val bar1: Int = 42
|
||||
open val bar2: Int get() = 42
|
||||
open val baz1: Int = 42
|
||||
open val baz2: Int get() = 42
|
||||
}
|
||||
-10
@@ -1,10 +0,0 @@
|
||||
package lib1
|
||||
|
||||
abstract class A {
|
||||
abstract val foo1: Int
|
||||
abstract val foo2: Int
|
||||
abstract val bar1: Int
|
||||
abstract val bar2: Int
|
||||
abstract val baz1: Int
|
||||
abstract val baz2: Int
|
||||
}
|
||||
Vendored
-12
@@ -1,12 +0,0 @@
|
||||
STEP 0:
|
||||
dependencies: stdlib
|
||||
modifications:
|
||||
U : l1.kt.0 -> l1.kt
|
||||
STEP 1:
|
||||
dependencies: stdlib
|
||||
modifications:
|
||||
U : l1.kt.1 -> l1.kt
|
||||
STEP 2:
|
||||
dependencies: stdlib
|
||||
modifications:
|
||||
U : l1.kt.0 -> l1.kt
|
||||
-38
@@ -1,38 +0,0 @@
|
||||
package lib2
|
||||
|
||||
import lib1.A
|
||||
|
||||
class B : A() {
|
||||
override val baz1 = -42
|
||||
override val baz2 get() = -42
|
||||
|
||||
val unlinkedPropertyUsage get() = foo1 + foo2 + bar1 + bar2
|
||||
}
|
||||
|
||||
class B1 : A() {
|
||||
override val baz1 = -42
|
||||
override val baz2 get() = -42
|
||||
|
||||
val unlinkedPropertyUsage = foo1
|
||||
}
|
||||
|
||||
class B2 : A() {
|
||||
override val baz1 = -42
|
||||
override val baz2 get() = -42
|
||||
|
||||
val unlinkedPropertyUsage = foo2
|
||||
}
|
||||
|
||||
class B3 : A() {
|
||||
override val baz1 = -42
|
||||
override val baz2 get() = -42
|
||||
|
||||
val unlinkedPropertyUsage = bar1
|
||||
}
|
||||
|
||||
class B4 : A() {
|
||||
override val baz1 = -42
|
||||
override val baz2 get() = -42
|
||||
|
||||
val unlinkedPropertyUsage = bar2
|
||||
}
|
||||
-23
@@ -1,23 +0,0 @@
|
||||
import abitestutils.abiTest
|
||||
import lib1.A
|
||||
import lib2.B
|
||||
import lib2.B1
|
||||
import lib2.B2
|
||||
import lib2.B3
|
||||
import lib2.B4
|
||||
|
||||
fun box() = abiTest {
|
||||
val a: A = B()
|
||||
val b = B()
|
||||
expectFailure(nonImplementedCallable("property accessor foo1.<get-foo1>", "class B")) { a.foo1 }
|
||||
expectFailure(nonImplementedCallable("property accessor foo2.<get-foo2>", "class B")) { a.foo2 }
|
||||
expectFailure(nonImplementedCallable("property accessor bar1.<get-bar1>", "class B")) { a.bar1 }
|
||||
expectFailure(nonImplementedCallable("property accessor bar2.<get-bar2>", "class B")) { a.bar2 }
|
||||
expectSuccess(-42) { a.baz1 }
|
||||
expectSuccess(-42) { a.baz2 }
|
||||
expectFailure(nonImplementedCallable("property accessor foo1.<get-foo1>", "class B")) { b.unlinkedPropertyUsage }
|
||||
expectFailure(nonImplementedCallable("property accessor foo1.<get-foo1>", "class B1")) { B1() }
|
||||
expectFailure(nonImplementedCallable("property accessor foo2.<get-foo2>", "class B2")) { B2() }
|
||||
expectFailure(nonImplementedCallable("property accessor bar1.<get-bar1>", "class B3")) { B3() }
|
||||
expectFailure(nonImplementedCallable("property accessor bar2.<get-bar2>", "class B4")) { B4() }
|
||||
}
|
||||
Vendored
-2
@@ -1,2 +0,0 @@
|
||||
STEP 0:
|
||||
dependencies: stdlib, lib1, lib2
|
||||
-6
@@ -1,6 +0,0 @@
|
||||
package lib1
|
||||
|
||||
interface A {
|
||||
val foo: Int get() = 42
|
||||
val bar: Int get() = 42
|
||||
}
|
||||
-6
@@ -1,6 +0,0 @@
|
||||
package lib1
|
||||
|
||||
interface A {
|
||||
val foo: Int
|
||||
val bar: Int
|
||||
}
|
||||
-12
@@ -1,12 +0,0 @@
|
||||
STEP 0:
|
||||
dependencies: stdlib
|
||||
modifications:
|
||||
U : l1.kt.0 -> l1.kt
|
||||
STEP 1:
|
||||
dependencies: stdlib
|
||||
modifications:
|
||||
U : l1.kt.1 -> l1.kt
|
||||
STEP 2:
|
||||
dependencies: stdlib
|
||||
modifications:
|
||||
U : l1.kt.0 -> l1.kt
|
||||
-15
@@ -1,15 +0,0 @@
|
||||
package lib2
|
||||
|
||||
import lib1.A
|
||||
|
||||
class B : A {
|
||||
override val bar get() = -42
|
||||
|
||||
val unlinkedPropertyUsage get() = foo
|
||||
}
|
||||
|
||||
class B1 : A {
|
||||
override val bar get() = -42
|
||||
|
||||
val unlinkedPropertyUsage = foo
|
||||
}
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
import abitestutils.abiTest
|
||||
import lib1.A
|
||||
import lib2.B
|
||||
import lib2.B1
|
||||
|
||||
fun box() = abiTest {
|
||||
val a: A = B()
|
||||
val b = B()
|
||||
expectFailure(nonImplementedCallable("property accessor foo.<get-foo>", "class B")) { a.foo }
|
||||
expectSuccess(-42) { a.bar }
|
||||
expectFailure(nonImplementedCallable("property accessor foo.<get-foo>", "class B")) { b.unlinkedPropertyUsage }
|
||||
expectFailure(nonImplementedCallable("property accessor foo.<get-foo>", "class B1")) { B1() }
|
||||
}
|
||||
-2
@@ -1,2 +0,0 @@
|
||||
STEP 0:
|
||||
dependencies: stdlib, lib1, lib2
|
||||
@@ -0,0 +1,27 @@
|
||||
sealed interface SI1 {
|
||||
class A : SI1
|
||||
class B : SI1
|
||||
}
|
||||
|
||||
sealed class SC1 {
|
||||
class A: SC1()
|
||||
class B: SC1()
|
||||
}
|
||||
|
||||
enum class E1 {
|
||||
A, B
|
||||
}
|
||||
|
||||
enum class E2 {
|
||||
A, B
|
||||
}
|
||||
|
||||
sealed interface SI2 {
|
||||
class ClassToObject : SI2
|
||||
object ObjectToClass : SI2
|
||||
}
|
||||
|
||||
sealed class SC2 {
|
||||
class ClassToObject : SC2()
|
||||
object ObjectToClass : SC2()
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
/*sealed*/ interface SI1 {
|
||||
class A : SI1
|
||||
class B : SI1
|
||||
}
|
||||
|
||||
/*sealed*/ abstract class SC1 {
|
||||
class A: SC1()
|
||||
class B: SC1()
|
||||
}
|
||||
|
||||
abstract class E1 {
|
||||
object A : E1()
|
||||
object B : E1()
|
||||
}
|
||||
|
||||
abstract class E2 {
|
||||
class A : E2()
|
||||
class B : E2()
|
||||
}
|
||||
|
||||
sealed interface SI2 {
|
||||
object ClassToObject : SI2
|
||||
class ObjectToClass : SI2
|
||||
}
|
||||
|
||||
sealed class SC2 {
|
||||
object ClassToObject : SC2()
|
||||
class ObjectToClass : SC2()
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
fun computeSC1(sealedClass: SC1): String = when (sealedClass) {
|
||||
is SC1.A -> "A"
|
||||
is SC1.B -> "B"
|
||||
}
|
||||
|
||||
fun computeSI1(sealedInterface: SI1): String = when (sealedInterface) {
|
||||
is SI1.A -> "A"
|
||||
is SI1.B -> "B"
|
||||
}
|
||||
|
||||
fun computeE1(enum: E1): String = when (enum) {
|
||||
E1.A -> "A"
|
||||
E1.B -> "B"
|
||||
}
|
||||
|
||||
fun computeE2(enum: E2): String = when (enum) {
|
||||
E2.A -> "A"
|
||||
E2.B -> "B"
|
||||
}
|
||||
|
||||
fun computeSC2(sealedClass: SC2): String = when (sealedClass) {
|
||||
is SC2.ClassToObject -> "ClassToObject"
|
||||
SC2.ObjectToClass -> "ObjectToClass"
|
||||
}
|
||||
|
||||
fun computeSI2(sealedInterface: SI2): String = when (sealedInterface) {
|
||||
is SI2.ClassToObject -> "ClassToObject"
|
||||
SI2.ObjectToClass -> "ObjectToClass"
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
import abitestutils.abiTest
|
||||
|
||||
fun box() = abiTest {
|
||||
class SI1_C : SI1
|
||||
class SC1_C : SC1()
|
||||
class E1_C : E1()
|
||||
class E2_C : E2()
|
||||
|
||||
expectSuccess("A") { computeSI1(SI1.A()) }
|
||||
expectFailure(noWhenBranch()) { computeSI1(SI1_C()) }
|
||||
expectSuccess("B") { computeSI1(SI1.B()) }
|
||||
|
||||
expectSuccess("A") { computeSC1(SC1.A()) }
|
||||
expectFailure(noWhenBranch()) { computeSC1(SC1_C()) }
|
||||
expectSuccess("B") { computeSC1(SC1.B()) }
|
||||
|
||||
expectFailure(linkage("Can not get instance of singleton 'E1.A': No enum entry found for symbol '/E1.A'")) { computeE1(E1.A) }
|
||||
expectFailure(linkage("Can not get instance of singleton 'E1.A': No enum entry found for symbol '/E1.A'")) { computeE1(E1_C()) }
|
||||
expectFailure(linkage("Can not get instance of singleton 'E1.A': No enum entry found for symbol '/E1.A'")) { computeE1(E1.B) }
|
||||
|
||||
expectFailure(linkage("Can not get instance of singleton 'E2.A': No enum entry found for symbol '/E2.A'")) { computeE2(E2.A()) }
|
||||
expectFailure(linkage("Can not get instance of singleton 'E2.A': No enum entry found for symbol '/E2.A'")) { computeE2(E2_C()) }
|
||||
expectFailure(linkage("Can not get instance of singleton 'E2.A': No enum entry found for symbol '/E2.A'")) { computeE2(E2.B()) }
|
||||
|
||||
expectSuccess("ClassToObject") { computeSI2(SI2.ClassToObject) }
|
||||
expectFailure(linkage("Can not get instance of singleton 'ObjectToClass': 'ObjectToClass' is class while object is expected")) { computeSI2(SI2.ObjectToClass()) }
|
||||
|
||||
expectSuccess("ClassToObject") { computeSC2(SC2.ClassToObject) }
|
||||
expectFailure(linkage("Can not get instance of singleton 'ObjectToClass': 'ObjectToClass' is class while object is expected")) { computeSC2(SC2.ObjectToClass()) }
|
||||
}
|
||||
+1
-1
@@ -1,2 +1,2 @@
|
||||
STEP 0:
|
||||
STEP 1:
|
||||
dependencies: stdlib, lib1, lib2
|
||||
+2
-5
@@ -1,10 +1,7 @@
|
||||
MODULES: lib1, lib2, main
|
||||
|
||||
STEP 0:
|
||||
libs: lib1, lib2, main
|
||||
|
||||
STEP 1:
|
||||
libs: lib1, lib2
|
||||
|
||||
STEP 2:
|
||||
libs: lib1
|
||||
STEP 1:
|
||||
libs: lib1, main
|
||||
@@ -0,0 +1,34 @@
|
||||
@file:Suppress("unused", "UNUSED_PARAMETER", "NOTHING_TO_INLINE")
|
||||
|
||||
open class OpenClass {
|
||||
@Suppress("MemberVisibilityCanBePrivate")
|
||||
var lastRecordedState: String = ""
|
||||
|
||||
open var openNonInlineToInlineProperty: String
|
||||
get() = "OpenClass.openNonInlineToInlineProperty"
|
||||
set(value) { lastRecordedState = "OpenClass.openNonInlineToInlineProperty=$value" }
|
||||
|
||||
open var openNonInlineToInlinePropertyWithDelegation: String
|
||||
get() = "OpenClass.openNonInlineToInlinePropertyWithDelegation"
|
||||
set(value) { lastRecordedState = "OpenClass.openNonInlineToInlinePropertyWithDelegation=$value" }
|
||||
|
||||
//inline var newInlineProperty1: String
|
||||
// get() = "OpenClass.newInlineProperty1"
|
||||
// set(value) { lastRecordedState = "OpenClass.newInlineProperty1=$value" }
|
||||
|
||||
//inline var newInlineProperty2: String
|
||||
// get() = "OpenClass.newInlineProperty2"
|
||||
// set(value) { lastRecordedState = "OpenClass.newInlineProperty2=$value" }
|
||||
|
||||
//var newNonInlineProperty: String
|
||||
// get() = "OpenClass.newNonInlineProperty"
|
||||
// set(value) { lastRecordedState = "OpenClass.newNonInlineProperty=$value" }
|
||||
|
||||
fun newInlineProperty1Reader(): String = TODO("Not implemented: OpenClass.newInlineProperty1Reader()")
|
||||
fun newInlineProperty2Reader(): String = TODO("Not implemented: OpenClass.newInlineProperty2Reader()")
|
||||
fun newNonInlinePropertyReader(): String = TODO("Not implemented: OpenClass.newNonInlinePropertyReader()")
|
||||
|
||||
fun newInlineProperty1Writer(value: String): Unit = TODO("Not implemented: OpenClass.newInlineProperty1Writer()")
|
||||
fun newInlineProperty2Writer(value: String): Unit = TODO("Not implemented: OpenClass.newInlineProperty2Writer()")
|
||||
fun newNonInlinePropertyWriter(value: String): Unit = TODO("Not implemented: OpenClass.newNonInlinePropertyWriter()")
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
@file:Suppress("unused", "UNUSED_PARAMETER", "NOTHING_TO_INLINE")
|
||||
|
||||
open class OpenClass {
|
||||
@Suppress("MemberVisibilityCanBePrivate")
|
||||
var lastRecordedState: String = ""
|
||||
|
||||
inline var openNonInlineToInlineProperty: String
|
||||
get() = "OpenClassV2.openNonInlineToInlineProperty"
|
||||
set(value) { lastRecordedState = "OpenClassV2.openNonInlineToInlineProperty=$value" }
|
||||
|
||||
inline var openNonInlineToInlinePropertyWithDelegation: String
|
||||
get() = "OpenClassV2.openNonInlineToInlinePropertyWithDelegation"
|
||||
set(value) { lastRecordedState = "OpenClassV2.openNonInlineToInlinePropertyWithDelegation=$value" }
|
||||
|
||||
inline var newInlineProperty1: String
|
||||
get() = "OpenClassV2.newInlineProperty1"
|
||||
set(value) { lastRecordedState = "OpenClassV2.newInlineProperty1=$value" }
|
||||
|
||||
inline var newInlineProperty2: String
|
||||
get() = "OpenClassV2.newInlineProperty2"
|
||||
set(value) { lastRecordedState = "OpenClassV2.newInlineProperty2=$value" }
|
||||
|
||||
var newNonInlineProperty: String
|
||||
get() = "OpenClassV2.newNonInlineProperty"
|
||||
set(value) { lastRecordedState = "OpenClassV2.newNonInlineProperty=$value" }
|
||||
|
||||
fun newInlineProperty1Reader(): String = newInlineProperty1
|
||||
fun newInlineProperty2Reader(): String = newInlineProperty2
|
||||
fun newNonInlinePropertyReader(): String = newNonInlineProperty
|
||||
|
||||
fun newInlineProperty1Writer(value: String) { newInlineProperty1 = value }
|
||||
fun newInlineProperty2Writer(value: String) { newInlineProperty2 = value }
|
||||
fun newNonInlinePropertyWriter(value: String) { newNonInlineProperty = value }
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
class OpenClassImpl : OpenClass() {
|
||||
override var openNonInlineToInlineProperty: String
|
||||
get() = "OpenClassImpl.openNonInlineToInlineProperty"
|
||||
set(value) { lastRecordedState = "OpenClassImpl.openNonInlineToInlineProperty=$value" }
|
||||
|
||||
override var openNonInlineToInlinePropertyWithDelegation: String
|
||||
get() = super.openNonInlineToInlinePropertyWithDelegation + " called from OpenClassImpl.openNonInlineToInlinePropertyWithDelegation"
|
||||
set(value) { super.openNonInlineToInlinePropertyWithDelegation = "$value called from OpenClassImpl.openNonInlineToInlinePropertyWithDelegation" }
|
||||
|
||||
var newInlineProperty1: String // overrides accidentally appeared inline property
|
||||
get() = "OpenClassImpl.newInlineProperty1"
|
||||
set(value) { lastRecordedState = "OpenClassImpl.newInlineProperty1=$value" }
|
||||
|
||||
inline var newInlineProperty2: String // overrides accidentally appeared inline property
|
||||
get() = "OpenClassImpl.newInlineProperty2"
|
||||
set(value) { lastRecordedState = "OpenClassImpl.newInlineProperty2=$value" }
|
||||
|
||||
inline var newNonInlineProperty: String // overrides accidentally appeared non-inline function
|
||||
get() = "OpenClassImpl.newNonInlineProperty"
|
||||
set(value) { lastRecordedState = "OpenClassImpl.newNonInlineProperty=$value" }
|
||||
}
|
||||
|
||||
fun openNonInlineToInlinePropertyInOpenClass(oc: OpenClass): String = oc.openNonInlineToInlineProperty
|
||||
fun openNonInlineToInlinePropertyWithDelegationInOpenClass(oc: OpenClass): String = oc.openNonInlineToInlinePropertyWithDelegation
|
||||
fun newInlineProperty1InOpenClass(oc: OpenClass): String = oc.newInlineProperty1Reader()
|
||||
fun newInlineProperty2InOpenClass(oc: OpenClass): String = oc.newInlineProperty2Reader()
|
||||
fun newNonInlinePropertyInOpenClass(oc: OpenClass): String = oc.newNonInlinePropertyReader()
|
||||
|
||||
fun openNonInlineToInlinePropertyInOpenClassImpl(oci: OpenClassImpl): String = oci.openNonInlineToInlineProperty
|
||||
fun openNonInlineToInlinePropertyWithDelegationInOpenClassImpl(oci: OpenClassImpl): String = oci.openNonInlineToInlinePropertyWithDelegation
|
||||
fun newInlineProperty1InOpenClassImpl(oci: OpenClassImpl): String = oci.newInlineProperty1
|
||||
fun newInlineProperty2InOpenClassImpl(oci: OpenClassImpl): String = oci.newInlineProperty2
|
||||
fun newNonInlinePropertyInOpenClassImpl(oci: OpenClassImpl): String = oci.newNonInlineProperty
|
||||
|
||||
fun openNonInlineToInlinePropertyInOpenClass(oc: OpenClass, value: String): String { oc.openNonInlineToInlineProperty = value; return oc.lastRecordedState }
|
||||
fun openNonInlineToInlinePropertyWithDelegationInOpenClass(oc: OpenClass, value: String): String { oc.openNonInlineToInlinePropertyWithDelegation = value; return oc.lastRecordedState }
|
||||
fun newInlineProperty1InOpenClass(oc: OpenClass, value: String): String { oc.newInlineProperty1Writer(value); return oc.lastRecordedState }
|
||||
fun newInlineProperty2InOpenClass(oc: OpenClass, value: String): String { oc.newInlineProperty2Writer(value); return oc.lastRecordedState }
|
||||
fun newNonInlinePropertyInOpenClass(oc: OpenClass, value: String): String { oc.newNonInlinePropertyWriter(value); return oc.lastRecordedState }
|
||||
|
||||
fun openNonInlineToInlinePropertyInOpenClassImpl(oci: OpenClassImpl, value: String): String { oci.openNonInlineToInlineProperty = value; return oci.lastRecordedState }
|
||||
fun openNonInlineToInlinePropertyWithDelegationInOpenClassImpl(oci: OpenClassImpl, value: String): String { oci.openNonInlineToInlinePropertyWithDelegation = value; return oci.lastRecordedState }
|
||||
fun newInlineProperty1InOpenClassImpl(oci: OpenClassImpl, value: String): String { oci.newInlineProperty1 = value; return oci.lastRecordedState }
|
||||
fun newInlineProperty2InOpenClassImpl(oci: OpenClassImpl, value: String): String { oci.newInlineProperty2 = value; return oci.lastRecordedState }
|
||||
fun newNonInlinePropertyInOpenClassImpl(oci: OpenClassImpl, value: String): String { oci.newNonInlineProperty = value; return oci.lastRecordedState }
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user