Add tests for obsolete issues
#KT-32395 Obsolete (fixed in42a5c488) #KT-32388 Obsolete (fixed inf3e4c9cd) #KT-32271 Obsolete (fixed in60a0cf1)
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
// !WITH_NEW_INFERENCE
|
||||
|
||||
fun <A, B> Either<A, B>.recover(f: (A) -> B): Either<A, B> = when (this) {
|
||||
is Either.Left -> f(<!DEBUG_INFO_SMARTCAST!>this<!>.a).right()
|
||||
is Either.Right -> <!NI;DEBUG_INFO_SMARTCAST!>this<!>
|
||||
}
|
||||
|
||||
fun <A> A.right(): Either<Nothing, A> = Either.Right(this)
|
||||
|
||||
sealed class Either<out A, out B> {
|
||||
class Left<out A> constructor(val a: A) : Either<A, Nothing>()
|
||||
class Right<out B> constructor(val b: B) : Either<Nothing, B>()
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package
|
||||
|
||||
public fun </*0*/ A, /*1*/ B> Either<A, B>.recover(/*0*/ f: (A) -> B): Either<A, B>
|
||||
public fun </*0*/ A> A.right(): Either<kotlin.Nothing, A>
|
||||
|
||||
public sealed class Either</*0*/ out A, /*1*/ out B> {
|
||||
private constructor Either</*0*/ out A, /*1*/ out B>()
|
||||
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 Left</*0*/ out A> : Either<A, kotlin.Nothing> {
|
||||
public constructor Left</*0*/ out A>(/*0*/ a: A)
|
||||
public final val a: A
|
||||
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 Right</*0*/ out B> : Either<kotlin.Nothing, B> {
|
||||
public constructor Right</*0*/ out B>(/*0*/ b: B)
|
||||
public final val b: B
|
||||
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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user