[FIR] Add testcases to throw class with unresolved parent.

^KT-60048 Fixed
This commit is contained in:
Vladimir Sukharev
2023-09-01 18:38:11 +02:00
committed by Space Team
parent 69b2e2c0ba
commit 3e2c662b6b
5 changed files with 32 additions and 4 deletions
@@ -40,6 +40,10 @@ fun throwsEmptyParens() {}
@Throws(<!ANNOTATION_ARGUMENT_MUST_BE_CONST!><!UNRESOLVED_REFERENCE!>UnresolvedException<!>::class<!>)
fun throwsUnresolved() {}
class Orphan : <!UNRESOLVED_REFERENCE!>MyUnresolvedParent<!>
@Throws(<!ARGUMENT_TYPE_MISMATCH!>Orphan::class<!>)
fun throwsClassWithUnresolvedParent() {}
@Throws(exceptionClasses = <!ANNOTATION_ARGUMENT_MUST_BE_CONST, ARGUMENT_TYPE_MISMATCH, ASSIGNING_SINGLE_ELEMENT_TO_VARARG_IN_NAMED_FORM_ANNOTATION_ERROR!><!UNRESOLVED_REFERENCE!>UnresolvedException<!>::class<!>)
fun throwsNamedUnresolved() {}
@@ -312,6 +316,9 @@ suspend fun suspendThrowsSpreadArrayOfUnresolved() {}
@Throws(UEAlias::class)
suspend fun suspendThrowsTypealiasToUnresolved() {}
@Throws(<!ARGUMENT_TYPE_MISMATCH!>Orphan::class<!>)
suspend fun suspendThrowsClassWithUnresolvedParent() {}
@Throws(Exception1::class, CancellationException::class)
suspend fun suspendThrowsCancellationException1() {}
+7
View File
@@ -40,6 +40,10 @@ fun throwsEmptyParens() {}
@Throws(<!ANNOTATION_ARGUMENT_MUST_BE_CONST!><!UNRESOLVED_REFERENCE!>UnresolvedException<!>::class<!>)
fun throwsUnresolved() {}
class Orphan : <!UNRESOLVED_REFERENCE!>MyUnresolvedParent<!>
@Throws(<!TYPE_MISMATCH!>Orphan::class<!>)
fun throwsClassWithUnresolvedParent() {}
@Throws(exceptionClasses = <!ANNOTATION_ARGUMENT_MUST_BE_CONST, ASSIGNING_SINGLE_ELEMENT_TO_VARARG_IN_NAMED_FORM_ANNOTATION_ERROR!><!UNRESOLVED_REFERENCE!>UnresolvedException<!>::class<!>)
fun throwsNamedUnresolved() {}
@@ -312,6 +316,9 @@ suspend fun suspendThrowsSpreadArrayOfUnresolved() {}
@Throws(<!ANNOTATION_ARGUMENT_MUST_BE_CONST!>UEAlias::class<!>)
suspend fun suspendThrowsTypealiasToUnresolved() {}
<!MISSING_EXCEPTION_IN_THROWS_ON_SUSPEND!>@Throws(<!TYPE_MISMATCH!>Orphan::class<!>)<!>
suspend fun suspendThrowsClassWithUnresolvedParent() {}
@Throws(Exception1::class, CancellationException::class)
suspend fun suspendThrowsCancellationException1() {}
+9
View File
@@ -6,6 +6,7 @@ package
@kotlin.Throws(exceptionClasses = {Exception1::class, kotlin.coroutines.cancellation.CancellationException::class}) public suspend fun suspendThrowsCancellationException1(): kotlin.Unit
@kotlin.Throws(exceptionClasses = {kotlin.coroutines.cancellation.CancellationException::class, Exception1::class}) public suspend fun suspendThrowsCancellationException2(): kotlin.Unit
@kotlin.Throws(exceptionClasses = {kotlin.coroutines.cancellation.CancellationException::class}) public suspend fun suspendThrowsCancellationExceptionTypealias(): kotlin.Unit
@kotlin.Throws(exceptionClasses = {Orphan::class}) public suspend fun suspendThrowsClassWithUnresolvedParent(): kotlin.Unit
@kotlin.Throws(exceptionClasses = {kotlin.Exception::class}) public suspend fun suspendThrowsException1(): kotlin.Unit
@kotlin.Throws(exceptionClasses = {Exception1::class, kotlin.Exception::class}) public suspend fun suspendThrowsException2(): kotlin.Unit
@kotlin.Throws(exceptionClasses = {kotlin.Exception::class}) public suspend fun suspendThrowsExceptionTypealias(): kotlin.Unit
@@ -31,6 +32,7 @@ package
@kotlin.Throws(exceptionClasses = {kotlin.Throwable::class}) public suspend fun suspendThrowsThrowableTypealias(): kotlin.Unit
@kotlin.Throws(exceptionClasses = {}) public suspend fun suspendThrowsTypealiasToUnresolved(): kotlin.Unit
@kotlin.Throws(exceptionClasses = {}) public suspend fun suspendThrowsUnresolved(): kotlin.Unit
@kotlin.Throws(exceptionClasses = {Orphan::class}) public fun throwsClassWithUnresolvedParent(): kotlin.Unit
@kotlin.Throws(exceptionClasses = {}) public fun throwsEmptyParens(): kotlin.Unit
@kotlin.Throws(exceptionClasses = {}) public fun throwsNamedArrayOfUnresolved(): kotlin.Unit
@kotlin.Throws(exceptionClasses = {}) public fun throwsNamedEmptyArrayOf(): kotlin.Unit
@@ -245,6 +247,13 @@ public final class InheritsThrowsAndNoThrows : Base0, Base1 {
public open override /*2*/ /*fake_override*/ fun toString(): kotlin.String
}
public final class Orphan {
public constructor Orphan()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public final class OverrideDifferentThrows4 : OverridesDifferentThrows3 {
public constructor OverrideDifferentThrows4()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean