Extract stub library file from "Result is Result" inspection tests
This commit is contained in:
-4
@@ -1,10 +1,6 @@
|
||||
// FIX: Unwrap 'Result' return type (breaks use-sites!)
|
||||
package kotlin
|
||||
|
||||
class Result<T>(val value: T?) {
|
||||
fun getOrThrow(): T = value ?: throw AssertionError("")
|
||||
}
|
||||
|
||||
abstract class Abstract {
|
||||
abstract fun <caret>foo(): Result<Int>
|
||||
}
|
||||
|
||||
-4
@@ -1,10 +1,6 @@
|
||||
// FIX: Unwrap 'Result' return type (breaks use-sites!)
|
||||
package kotlin
|
||||
|
||||
class Result<T>(val value: T?) {
|
||||
fun getOrThrow(): T = value ?: throw AssertionError("")
|
||||
}
|
||||
|
||||
abstract class Abstract {
|
||||
abstract fun foo(): Int
|
||||
}
|
||||
|
||||
-4
@@ -1,9 +1,5 @@
|
||||
package kotlin
|
||||
|
||||
class Result<T>(val value: T?) {
|
||||
fun getOrThrow(): T = value ?: throw AssertionError("")
|
||||
}
|
||||
|
||||
fun test() {
|
||||
val x = <caret>fun() = Result("123")
|
||||
}
|
||||
|
||||
-4
@@ -1,9 +1,5 @@
|
||||
package kotlin
|
||||
|
||||
class Result<T>(val value: T?) {
|
||||
fun getOrThrow(): T = value ?: throw AssertionError("")
|
||||
}
|
||||
|
||||
fun test() {
|
||||
val x = fun() = Result("123").getOrThrow()
|
||||
}
|
||||
|
||||
-4
@@ -3,10 +3,6 @@
|
||||
|
||||
package kotlin
|
||||
|
||||
class Result<T>(val value: T?) {
|
||||
fun getOrThrow(): T = value ?: throw AssertionError("")
|
||||
}
|
||||
|
||||
@Suppress("RESULT_CLASS_IN_RETURN_TYPE")
|
||||
fun <caret>incorrectBlock(arg: Boolean, arg2: Boolean?): Result<Int> {
|
||||
if (arg) {
|
||||
|
||||
-4
@@ -3,10 +3,6 @@
|
||||
|
||||
package kotlin
|
||||
|
||||
class Result<T>(val value: T?) {
|
||||
fun getOrThrow(): T = value ?: throw AssertionError("")
|
||||
}
|
||||
|
||||
@Suppress("RESULT_CLASS_IN_RETURN_TYPE")
|
||||
fun incorrectBlock(arg: Boolean, arg2: Boolean?): Int {
|
||||
if (arg) {
|
||||
|
||||
-4
@@ -1,9 +1,5 @@
|
||||
package kotlin
|
||||
|
||||
class Result<T>(val value: T?) {
|
||||
fun getOrThrow(): T = value ?: throw AssertionError("")
|
||||
}
|
||||
|
||||
fun test() {
|
||||
val x = <caret>{ Result(true) }
|
||||
}
|
||||
|
||||
-4
@@ -1,9 +1,5 @@
|
||||
package kotlin
|
||||
|
||||
class Result<T>(val value: T?) {
|
||||
fun getOrThrow(): T = value ?: throw AssertionError("")
|
||||
}
|
||||
|
||||
fun test() {
|
||||
val x = { Result(true).getOrThrow() }
|
||||
}
|
||||
|
||||
Vendored
-4
@@ -1,9 +1,5 @@
|
||||
package kotlin
|
||||
|
||||
class Result<T>(val value: T?) {
|
||||
fun getOrThrow(): T = value ?: throw AssertionError("")
|
||||
}
|
||||
|
||||
fun test(arg: Boolean) {
|
||||
val x = foo@<caret>{
|
||||
if (!arg) {
|
||||
|
||||
Vendored
-4
@@ -1,9 +1,5 @@
|
||||
package kotlin
|
||||
|
||||
class Result<T>(val value: T?) {
|
||||
fun getOrThrow(): T = value ?: throw AssertionError("")
|
||||
}
|
||||
|
||||
fun test(arg: Boolean) {
|
||||
val x = foo@{
|
||||
(if (!arg) {
|
||||
|
||||
-4
@@ -1,9 +1,5 @@
|
||||
package kotlin
|
||||
|
||||
class Result<T>(val value: T?) {
|
||||
fun getOrThrow(): T = value ?: throw AssertionError("")
|
||||
}
|
||||
|
||||
fun test() {
|
||||
val x = foo@<caret>{ return@foo Result(true) }
|
||||
}
|
||||
|
||||
Vendored
-4
@@ -1,9 +1,5 @@
|
||||
package kotlin
|
||||
|
||||
class Result<T>(val value: T?) {
|
||||
fun getOrThrow(): T = value ?: throw AssertionError("")
|
||||
}
|
||||
|
||||
fun test() {
|
||||
val x = foo@<caret>{ return@foo Result(true).getOrThrow() }
|
||||
}
|
||||
|
||||
-7
@@ -1,12 +1,5 @@
|
||||
// FIX: Add '.getOrThrow()' to function result (breaks use-sites!)
|
||||
package kotlin
|
||||
|
||||
class Result<T>(val value: T?) {
|
||||
fun getOrThrow(): T = value ?: throw AssertionError("")
|
||||
|
||||
@Suppress("RESULT_CLASS_IN_RETURN_TYPE")
|
||||
operator fun plus(other: Result<T>) = other
|
||||
}
|
||||
|
||||
@Suppress("RESULT_CLASS_IN_RETURN_TYPE")
|
||||
fun <caret>incorrect() = Result("123") + Result("456")
|
||||
|
||||
Vendored
-7
@@ -1,12 +1,5 @@
|
||||
// FIX: Add '.getOrThrow()' to function result (breaks use-sites!)
|
||||
package kotlin
|
||||
|
||||
class Result<T>(val value: T?) {
|
||||
fun getOrThrow(): T = value ?: throw AssertionError("")
|
||||
|
||||
@Suppress("RESULT_CLASS_IN_RETURN_TYPE")
|
||||
operator fun plus(other: Result<T>) = other
|
||||
}
|
||||
|
||||
@Suppress("RESULT_CLASS_IN_RETURN_TYPE")
|
||||
fun incorrect() = (Result("123") + Result("456")).getOrThrow()
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
// FIX: Rename to 'incorrectCatching'
|
||||
package kotlin
|
||||
|
||||
class Result<T>(val value: T?) {
|
||||
fun getOrThrow(): T = value ?: throw AssertionError("")
|
||||
}
|
||||
|
||||
@Suppress("RESULT_CLASS_IN_RETURN_TYPE")
|
||||
fun <caret>incorrect() = Result("123")
|
||||
|
||||
-4
@@ -1,9 +1,5 @@
|
||||
// FIX: Rename to 'incorrectCatching'
|
||||
package kotlin
|
||||
|
||||
class Result<T>(val value: T?) {
|
||||
fun getOrThrow(): T = value ?: throw AssertionError("")
|
||||
}
|
||||
|
||||
@Suppress("RESULT_CLASS_IN_RETURN_TYPE")
|
||||
fun <caret>incorrectCatching() = Result("123")
|
||||
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package kotlin
|
||||
|
||||
class Result<T>(val value: T?) {
|
||||
fun getOrThrow(): T = value ?: throw AssertionError("")
|
||||
|
||||
@Suppress("RESULT_CLASS_IN_RETURN_TYPE")
|
||||
operator fun plus(other: Result<T>) = other
|
||||
}
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
// FIX: Add '.getOrThrow()' to function result (breaks use-sites!)
|
||||
package kotlin
|
||||
|
||||
class Result<T>(val value: T?) {
|
||||
fun getOrThrow(): T = value ?: throw AssertionError("")
|
||||
}
|
||||
|
||||
fun <caret>incorrect() = Result("123")
|
||||
|
||||
-4
@@ -1,8 +1,4 @@
|
||||
// FIX: Add '.getOrThrow()' to function result (breaks use-sites!)
|
||||
package kotlin
|
||||
|
||||
class Result<T>(val value: T?) {
|
||||
fun getOrThrow(): T = value ?: throw AssertionError("")
|
||||
}
|
||||
|
||||
fun incorrect() = Result("123").getOrThrow()
|
||||
|
||||
-4
@@ -1,10 +1,6 @@
|
||||
// FIX: Add '.getOrThrow()' to function result (breaks use-sites!)
|
||||
package kotlin
|
||||
|
||||
class Result<T>(val value: T?) {
|
||||
fun getOrThrow(): T = value ?: throw AssertionError("")
|
||||
}
|
||||
|
||||
fun <caret>incorrectBlock(arg: Boolean, arg2: Boolean?): Result<Int> {
|
||||
if (arg) {
|
||||
return Result(1)
|
||||
|
||||
-4
@@ -1,10 +1,6 @@
|
||||
// FIX: Add '.getOrThrow()' to function result (breaks use-sites!)
|
||||
package kotlin
|
||||
|
||||
class Result<T>(val value: T?) {
|
||||
fun getOrThrow(): T = value ?: throw AssertionError("")
|
||||
}
|
||||
|
||||
fun incorrectBlock(arg: Boolean, arg2: Boolean?): Int {
|
||||
if (arg) {
|
||||
return Result(1).getOrThrow()
|
||||
|
||||
Reference in New Issue
Block a user