Remove ConvertAssertToIfWithThrowIntention
Relates to #KT-31502
This commit is contained in:
@@ -1 +0,0 @@
|
||||
org.jetbrains.kotlin.idea.intentions.ConvertAssertToIfWithThrowIntention
|
||||
@@ -1,9 +0,0 @@
|
||||
package a
|
||||
|
||||
fun foo() {
|
||||
<caret>assert(true, { "text" })
|
||||
}
|
||||
|
||||
class AssertionError
|
||||
|
||||
// WITH_RUNTIME
|
||||
@@ -1,11 +0,0 @@
|
||||
package a
|
||||
|
||||
fun foo() {
|
||||
if (!true) {
|
||||
throw AssertionError("text")
|
||||
}
|
||||
}
|
||||
|
||||
class AssertionError
|
||||
|
||||
// WITH_RUNTIME
|
||||
@@ -1,4 +0,0 @@
|
||||
// WITH_RUNTIME
|
||||
fun foo() {
|
||||
<caret>assert(true && false, { "text" })
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
// WITH_RUNTIME
|
||||
fun foo() {
|
||||
if (!(true && false)) {
|
||||
throw AssertionError("text")
|
||||
}
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
// WITH_RUNTIME
|
||||
fun foo() {
|
||||
<caret>assert(1 > 0) { "text" }
|
||||
}
|
||||
-6
@@ -1,6 +0,0 @@
|
||||
// WITH_RUNTIME
|
||||
fun foo() {
|
||||
if (1 <= 0) {
|
||||
throw AssertionError("text")
|
||||
}
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
// WITH_RUNTIME
|
||||
fun foo() {
|
||||
<caret>assert(0 != 1) { "text" }
|
||||
}
|
||||
-6
@@ -1,6 +0,0 @@
|
||||
// WITH_RUNTIME
|
||||
fun foo() {
|
||||
if (0 == 1) {
|
||||
throw AssertionError("text")
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
// WITH_RUNTIME
|
||||
fun foo() {
|
||||
val x = true
|
||||
val y = false
|
||||
<caret>assert(x || y) { "text" }
|
||||
}
|
||||
-8
@@ -1,8 +0,0 @@
|
||||
// WITH_RUNTIME
|
||||
fun foo() {
|
||||
val x = true
|
||||
val y = false
|
||||
if (!(x || y)) {
|
||||
throw AssertionError("text")
|
||||
}
|
||||
}
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
fun main(args: Array<String>) {
|
||||
asse<caret>rt(false) { "mess" as kotlin.String }
|
||||
}
|
||||
|
||||
// WITH_RUNTIME
|
||||
-7
@@ -1,7 +0,0 @@
|
||||
fun main(args: Array<String>) {
|
||||
if (!false) {
|
||||
throw AssertionError("mess" as kotlin.String)
|
||||
}
|
||||
}
|
||||
|
||||
// WITH_RUNTIME
|
||||
@@ -1,4 +0,0 @@
|
||||
// WITH_RUNTIME
|
||||
fun foo() {
|
||||
kotlin.<caret>assert(true) {"text"}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
// WITH_RUNTIME
|
||||
fun foo() {
|
||||
if (!true) {
|
||||
throw AssertionError("text")
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
// WITH_RUNTIME
|
||||
fun foo() {
|
||||
<caret>assert(bar()) { "text" }
|
||||
}
|
||||
|
||||
fun bar(): Boolean = true
|
||||
@@ -1,8 +0,0 @@
|
||||
// WITH_RUNTIME
|
||||
fun foo() {
|
||||
if (!bar()) {
|
||||
throw AssertionError("text")
|
||||
}
|
||||
}
|
||||
|
||||
fun bar(): Boolean = true
|
||||
-6
@@ -1,6 +0,0 @@
|
||||
// WITH_RUNTIME
|
||||
fun foo() {
|
||||
<caret>assert(true, ::message)
|
||||
}
|
||||
|
||||
fun message(): String = "text"
|
||||
-8
@@ -1,8 +0,0 @@
|
||||
// WITH_RUNTIME
|
||||
fun foo() {
|
||||
if (!true) {
|
||||
throw AssertionError(message())
|
||||
}
|
||||
}
|
||||
|
||||
fun message(): String = "text"
|
||||
@@ -1,7 +0,0 @@
|
||||
// IS_APPLICABLE: false
|
||||
// WITH_RUNTIME
|
||||
fun foo() {
|
||||
<caret>assert(true, "")
|
||||
}
|
||||
|
||||
fun assert(b: Boolean, s: String) {}
|
||||
-9
@@ -1,9 +0,0 @@
|
||||
// IS_APPLICABLE: false
|
||||
// WITH_RUNTIME
|
||||
package pr442.kotlin
|
||||
|
||||
fun foo() {
|
||||
<caret>assert(true, "")
|
||||
}
|
||||
|
||||
fun assert(b: Boolean, s: String) {}
|
||||
@@ -1,7 +0,0 @@
|
||||
// IS_APPLICABLE: false
|
||||
// WITH_RUNTIME
|
||||
// ERROR: None of the following functions can be called with the arguments supplied: <br>@InlineOnly public inline fun assert(value: Boolean): Unit defined in kotlin<br>@InlineOnly public inline fun assert(value: Boolean, lazyMessage: () -> Any): Unit defined in kotlin
|
||||
|
||||
fun foo() {
|
||||
<caret>assert()
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
// WITH_RUNTIME
|
||||
fun foo() {
|
||||
<caret>assert(true, {
|
||||
if (true) "text" else return
|
||||
})
|
||||
}
|
||||
-6
@@ -1,6 +0,0 @@
|
||||
// WITH_RUNTIME
|
||||
fun foo() {
|
||||
if (!true) {
|
||||
throw AssertionError(if (true) "text" else return)
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
// WITH_RUNTIME
|
||||
// SKIP_ERRORS_AFTER
|
||||
// TODO: 'return' is not allowed here
|
||||
fun foo() {
|
||||
<caret>assert(true) {
|
||||
return
|
||||
}
|
||||
}
|
||||
-10
@@ -1,10 +0,0 @@
|
||||
// WITH_RUNTIME
|
||||
// SKIP_ERRORS_AFTER
|
||||
// TODO: 'return' is not allowed here
|
||||
fun foo() {
|
||||
if (!true) {
|
||||
throw AssertionError({
|
||||
return
|
||||
}())
|
||||
}
|
||||
}
|
||||
-7
@@ -1,7 +0,0 @@
|
||||
// WITH_RUNTIME
|
||||
fun foo() {
|
||||
<caret>assert(true, {
|
||||
val value = 1
|
||||
"text and $value"
|
||||
})
|
||||
}
|
||||
Vendored
-9
@@ -1,9 +0,0 @@
|
||||
// WITH_RUNTIME
|
||||
fun foo() {
|
||||
if (!true) {
|
||||
throw AssertionError({
|
||||
val value = 1
|
||||
"text and $value"
|
||||
}())
|
||||
}
|
||||
}
|
||||
Vendored
-9
@@ -1,9 +0,0 @@
|
||||
// WITH_RUNTIME
|
||||
// SKIP_ERRORS_AFTER
|
||||
// TODO: 'return' is not allowed here
|
||||
fun foo() {
|
||||
<caret>assert(true) {
|
||||
if (false) return
|
||||
"text"
|
||||
}
|
||||
}
|
||||
Vendored
-11
@@ -1,11 +0,0 @@
|
||||
// WITH_RUNTIME
|
||||
// SKIP_ERRORS_AFTER
|
||||
// TODO: 'return' is not allowed here
|
||||
fun foo() {
|
||||
if (!true) {
|
||||
throw AssertionError({
|
||||
if (false) return
|
||||
"text"
|
||||
}())
|
||||
}
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
// WITH_RUNTIME
|
||||
fun foo() {
|
||||
val f = { "text" }
|
||||
<caret>assert(true, f)
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
// WITH_RUNTIME
|
||||
fun foo() {
|
||||
val f = { "text" }
|
||||
if (!true) {
|
||||
throw AssertionError(f())
|
||||
}
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
// WITH_RUNTIME
|
||||
fun foo() {
|
||||
<caret>assert(true)
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
// WITH_RUNTIME
|
||||
fun foo() {
|
||||
if (!true) {
|
||||
throw AssertionError("Assertion failed")
|
||||
}
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
// WITH_RUNTIME
|
||||
fun foo() {
|
||||
<caret>assert((true && false)) { "text" }
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
// WITH_RUNTIME
|
||||
fun foo() {
|
||||
if (!(true && false)) {
|
||||
throw AssertionError("text")
|
||||
}
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
// WITH_RUNTIME
|
||||
fun foo() {
|
||||
<caret>assert(true) { "text" }
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
// WITH_RUNTIME
|
||||
fun foo() {
|
||||
if (!true) {
|
||||
throw AssertionError("text")
|
||||
}
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
// WITH_RUNTIME
|
||||
fun foo() {
|
||||
val f = "text"
|
||||
<caret>assert(true) { f }
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
// WITH_RUNTIME
|
||||
fun foo() {
|
||||
val f = "text"
|
||||
if (!true) {
|
||||
throw AssertionError(f)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user