Adjust KotlinSuppressIntentionAction to syntax with '@'
This commit is contained in:
@@ -226,9 +226,9 @@ public class JetPsiFactory(private val project: Project) {
|
||||
return createProperty(text + " val x").getModifierList()!!
|
||||
}
|
||||
|
||||
public fun createAnnotation(text: String): JetAnnotation {
|
||||
public fun createAnnotationEntry(text: String): JetAnnotationEntry {
|
||||
val modifierList = createProperty(text + " val x").getModifierList()
|
||||
return modifierList!!.getAnnotations().first()
|
||||
return modifierList!!.getAnnotationEntries().first()
|
||||
}
|
||||
|
||||
public fun createEmptyBody(): JetBlockExpression {
|
||||
|
||||
+3
-3
@@ -66,7 +66,7 @@ public class KotlinSuppressIntentionAction(
|
||||
val entry = findSuppressAnnotation(suppressAt)
|
||||
if (entry == null) {
|
||||
// no [suppress] annotation
|
||||
val newAnnotation = psiFactory.createAnnotation(suppressAnnotationText(id))
|
||||
val newAnnotation = psiFactory.createAnnotationEntry(suppressAnnotationText(id))
|
||||
val addedAnnotation = modifierList.addBefore(newAnnotation, modifierList.getFirstChild())
|
||||
val whiteSpace = psiFactory.createWhiteSpace(kind)
|
||||
modifierList.addAfter(whiteSpace, addedAnnotation)
|
||||
@@ -81,7 +81,7 @@ public class KotlinSuppressIntentionAction(
|
||||
private fun suppressAtAnnotatedExpression(suppressAt: CaretBox<JetAnnotatedExpression>, id: String) {
|
||||
val entry = findSuppressAnnotation(suppressAt.expression)
|
||||
if (entry != null) {
|
||||
// already annotated with [suppress]
|
||||
// already annotated with @suppress
|
||||
addArgumentToSuppressAnnotation(entry, id)
|
||||
}
|
||||
else {
|
||||
@@ -129,7 +129,7 @@ public class KotlinSuppressIntentionAction(
|
||||
}
|
||||
}
|
||||
|
||||
private fun suppressAnnotationText(id: String) = "[suppress($id)]"
|
||||
private fun suppressAnnotationText(id: String) = "@suppress($id)"
|
||||
|
||||
private fun findSuppressAnnotation(annotated: JetAnnotated): JetAnnotationEntry? {
|
||||
val context = annotated.analyze()
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
// "Suppress 'REDUNDANT_NULLABLE' for parameter p" "true"
|
||||
|
||||
fun foo([suppress("REDUNDANT_NULLABLE")] vararg p: String?<caret>?) = null
|
||||
fun foo(@suppress("REDUNDANT_NULLABLE") vararg p: String?<caret>?) = null
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
// "Suppress 'REDUNDANT_NULLABLE' for fun foo" "true"
|
||||
|
||||
[suppress("REDUNDANT_NULLABLE")]
|
||||
@suppress("REDUNDANT_NULLABLE")
|
||||
public
|
||||
fun foo(): String?<caret>? = null
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Suppress 'REDUNDANT_NULLABLE' for fun foo" "true"
|
||||
|
||||
[suppress("REDUNDANT_NULLABLE")]
|
||||
@suppress("REDUNDANT_NULLABLE")
|
||||
public fun foo(): String?<caret>? = null
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Suppress 'REDUNDANT_NULLABLE' for fun foo" "true"
|
||||
|
||||
[suppress("REDUNDANT_NULLABLE")]
|
||||
@suppress("REDUNDANT_NULLABLE")
|
||||
fun foo(): String?<caret>? = null
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Suppress 'REDUNDANT_NULLABLE' for fun foo" "true"
|
||||
|
||||
[suppress("FOO", "REDUNDANT_NULLABLE")]
|
||||
@suppress("FOO", "REDUNDANT_NULLABLE")
|
||||
fun foo(): String?<caret>? = null
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Suppress 'REDUNDANT_NULLABLE' for fun foo" "true"
|
||||
|
||||
[suppress("REDUNDANT_NULLABLE")]
|
||||
@suppress("REDUNDANT_NULLABLE")
|
||||
fun foo(): String?<caret>? = null
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Suppress 'REDUNDANT_NULLABLE' for fun foo" "true"
|
||||
|
||||
[suppress("REDUNDANT_NULLABLE")]
|
||||
@suppress("REDUNDANT_NULLABLE")
|
||||
fun foo(): String?<caret>? = null
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
// "Suppress 'REDUNDANT_NULLABLE' for fun foo" "true"
|
||||
|
||||
[suppress("REDUNDANT_NULLABLE")] fun foo(): String?<caret>? = null
|
||||
@suppress("REDUNDANT_NULLABLE") fun foo(): String?<caret>? = null
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
// "Suppress 'REDUNDANT_NULLABLE' for fun foo" "true"
|
||||
|
||||
[suppress("REDUNDANT_NULLABLE")]
|
||||
@suppress("REDUNDANT_NULLABLE")
|
||||
[ann] fun foo(): String?<caret>? = null
|
||||
|
||||
annotation class ann
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
// "Suppress 'REDUNDANT_NULLABLE' for fun foo" "true"
|
||||
|
||||
[suppress("REDUNDANT_NULLABLE")]
|
||||
@suppress("REDUNDANT_NULLABLE")
|
||||
ann fun foo(): String?<caret>? = null
|
||||
|
||||
annotation class ann
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Suppress 'REDUNDANT_NULLABLE' for fun foo" "true"
|
||||
|
||||
[suppress("FOO")]
|
||||
@suppress("FOO")
|
||||
fun foo(): String?<caret>? = null
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Suppress 'REDUNDANT_NULLABLE' for fun foo" "true"
|
||||
|
||||
[suppress()]
|
||||
@suppress()
|
||||
fun foo(): String?<caret>? = null
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Suppress 'REDUNDANT_NULLABLE' for fun foo" "true"
|
||||
|
||||
[suppress]
|
||||
@suppress
|
||||
fun foo(): String?<caret>? = null
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
// "Suppress 'REDUNDANT_NULLABLE' for fun foo" "true"
|
||||
|
||||
[suppress] fun foo(): String?<caret>? = null
|
||||
@suppress fun foo(): String?<caret>? = null
|
||||
@@ -1,6 +1,6 @@
|
||||
// "Suppress 'REDUNDANT_NULLABLE' for fun local" "true"
|
||||
|
||||
fun foo() {
|
||||
[suppress("REDUNDANT_NULLABLE")]
|
||||
@suppress("REDUNDANT_NULLABLE")
|
||||
fun local(): String?<caret>? = null
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// "Suppress 'REDUNDANT_NULLABLE' for fun foo" "true"
|
||||
|
||||
[suppress("REDUNDANT_NULLABLE")]
|
||||
@suppress("REDUNDANT_NULLABLE")
|
||||
fun foo() {
|
||||
fun local(): String?<caret>? = null
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// "Suppress 'REDUNDANT_NULLABLE' for fun foo" "true"
|
||||
|
||||
[suppress("REDUNDANT_NULLABLE")]
|
||||
@suppress("REDUNDANT_NULLABLE")
|
||||
fun foo() {
|
||||
val a: String?<caret>? = null
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// "Suppress 'REDUNDANT_NULLABLE' for val a" "true"
|
||||
|
||||
fun foo() {
|
||||
[suppress("REDUNDANT_NULLABLE")]
|
||||
@suppress("REDUNDANT_NULLABLE")
|
||||
val a: String?<caret>? = null
|
||||
}
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
class C {
|
||||
class D {
|
||||
[suppress("REDUNDANT_NULLABLE")]
|
||||
@suppress("REDUNDANT_NULLABLE")
|
||||
fun foo(): String?<caret>? = null
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
// "Suppress 'REDUNDANT_NULLABLE' for class D" "true"
|
||||
|
||||
class C {
|
||||
[suppress("REDUNDANT_NULLABLE")]
|
||||
@suppress("REDUNDANT_NULLABLE")
|
||||
class D {
|
||||
fun foo(): String?<caret>? = null
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// "Suppress 'REDUNDANT_NULLABLE' for class C" "true"
|
||||
|
||||
[suppress("REDUNDANT_NULLABLE")]
|
||||
@suppress("REDUNDANT_NULLABLE")
|
||||
class C {
|
||||
class D {
|
||||
fun foo(): String?<caret>? = null
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// "Suppress 'REDUNDANT_NULLABLE' for class C" "true"
|
||||
|
||||
[suppress("REDUNDANT_NULLABLE")]
|
||||
@suppress("REDUNDANT_NULLABLE")
|
||||
class C {
|
||||
fun foo(): String?<caret>? = null
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
// "Suppress 'REDUNDANT_NULLABLE' for fun foo" "true"
|
||||
|
||||
class C {
|
||||
[suppress("REDUNDANT_NULLABLE")]
|
||||
@suppress("REDUNDANT_NULLABLE")
|
||||
fun foo(): String?<caret>? = null
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "class com.intellij.codeInspection.SuppressIntentionAction" "false"
|
||||
|
||||
[suppress("REDUNDANT_NULLABLE")]
|
||||
@suppress("REDUNDANT_NULLABLE")
|
||||
fun foo(): String?<caret>? = null
|
||||
@@ -1,6 +1,6 @@
|
||||
// "Suppress 'REDUNDANT_NULLABLE' for class C" "true"
|
||||
|
||||
[suppress("REDUNDANT_NULLABLE")]
|
||||
@suppress("REDUNDANT_NULLABLE")
|
||||
class C {
|
||||
var foo: String?<caret>? = null
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
// "Suppress 'REDUNDANT_NULLABLE' for companion object Companion of C" "true"
|
||||
|
||||
class C {
|
||||
[suppress("REDUNDANT_NULLABLE")]
|
||||
@suppress("REDUNDANT_NULLABLE")
|
||||
companion object {
|
||||
var foo: String?<caret>? = null
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// "Suppress 'REDUNDANT_NULLABLE' for enum entry A" "true"
|
||||
|
||||
enum class E {
|
||||
[suppress("REDUNDANT_NULLABLE")]
|
||||
@suppress("REDUNDANT_NULLABLE")
|
||||
A {
|
||||
fun foo(): String?? = null
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Suppress 'REDUNDANT_NULLABLE' for fun foo" "true"
|
||||
|
||||
[suppress("REDUNDANT_NULLABLE")]
|
||||
@suppress("REDUNDANT_NULLABLE")
|
||||
fun foo(): String?<caret>? = null
|
||||
@@ -1,7 +1,7 @@
|
||||
// "Suppress 'REDUNDANT_NULLABLE' for val (a, b)" "true"
|
||||
|
||||
fun foo() {
|
||||
[suppress("REDUNDANT_NULLABLE")]
|
||||
@suppress("REDUNDANT_NULLABLE")
|
||||
val (a, b) = Pair<String?<caret>?, String>("", "")
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// "Suppress 'REDUNDANT_NULLABLE' for var (a, b)" "true"
|
||||
|
||||
fun foo() {
|
||||
[suppress("REDUNDANT_NULLABLE")]
|
||||
@suppress("REDUNDANT_NULLABLE")
|
||||
var (a, b) = Pair<String?<caret>?, String>("", "")
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// "Suppress 'REDUNDANT_NULLABLE' for object C" "true"
|
||||
|
||||
[suppress("REDUNDANT_NULLABLE")]
|
||||
@suppress("REDUNDANT_NULLABLE")
|
||||
object C {
|
||||
var foo: String?<caret>? = null
|
||||
}
|
||||
@@ -1,3 +1,3 @@
|
||||
// "Suppress 'REDUNDANT_NULLABLE' for parameter p" "true"
|
||||
|
||||
fun foo([suppress("REDUNDANT_NULLABLE")] p: String?<caret>?) = null
|
||||
fun foo(@suppress("REDUNDANT_NULLABLE") p: String?<caret>?) = null
|
||||
@@ -1,6 +1,6 @@
|
||||
// "Suppress 'REDUNDANT_NULLABLE' for trait C" "true"
|
||||
|
||||
[suppress("REDUNDANT_NULLABLE")]
|
||||
@suppress("REDUNDANT_NULLABLE")
|
||||
trait C {
|
||||
var foo: String?<caret>?
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Suppress 'REDUNDANT_NULLABLE' for val foo" "true"
|
||||
|
||||
[suppress("REDUNDANT_NULLABLE")]
|
||||
@suppress("REDUNDANT_NULLABLE")
|
||||
val foo: String?<caret>? = null
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Suppress 'REDUNDANT_NULLABLE' for var foo" "true"
|
||||
|
||||
[suppress("REDUNDANT_NULLABLE")]
|
||||
@suppress("REDUNDANT_NULLABLE")
|
||||
var foo: String?<caret>? = null
|
||||
@@ -1,5 +1,5 @@
|
||||
// "Suppress 'REDUNDANT_NULLABLE' for fun foo" "true"
|
||||
// ERROR: An integer literal does not conform to the expected type kotlin.String
|
||||
|
||||
[suppress(1, "REDUNDANT_NULLABLE")]
|
||||
@suppress(1, "REDUNDANT_NULLABLE")
|
||||
fun foo(): String?<caret>? = null
|
||||
@@ -1,5 +1,5 @@
|
||||
// "Suppress 'REDUNDANT_NULLABLE' for fun foo" "true"
|
||||
// ERROR: Unresolved reference: ann
|
||||
|
||||
[suppress("REDUNDANT_NULLABLE")]
|
||||
@suppress("REDUNDANT_NULLABLE")
|
||||
[ann] fun foo(): String?<caret>? = null
|
||||
@@ -1,5 +1,5 @@
|
||||
// "Suppress 'REDUNDANT_NULLABLE' for fun foo" "true"
|
||||
// ERROR: An integer literal does not conform to the expected type kotlin.String
|
||||
|
||||
[suppress(1)]
|
||||
@suppress(1)
|
||||
fun foo(): String?<caret>? = null
|
||||
@@ -1,6 +1,6 @@
|
||||
// "Suppress 'UNNECESSARY_NOT_NULL_ASSERTION' for statement " "true"
|
||||
|
||||
fun foo() {
|
||||
[suppress("UNNECESSARY_NOT_NULL_ASSERTION")]
|
||||
@suppress("UNNECESSARY_NOT_NULL_ASSERTION")
|
||||
(false<caret>!! && true)
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
// "Suppress 'UNNECESSARY_NOT_NULL_ASSERTION' for statement " "true"
|
||||
|
||||
fun foo() {
|
||||
[suppress("UNNECESSARY_NOT_NULL_ASSERTION")]
|
||||
@suppress("UNNECESSARY_NOT_NULL_ASSERTION")
|
||||
[ann] ""<caret>!!
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// "Suppress 'UNNECESSARY_NOT_NULL_ASSERTION' for statement " "true"
|
||||
|
||||
fun foo() {
|
||||
[suppress("Foo", "UNNECESSARY_NOT_NULL_ASSERTION")] ""<caret>!!
|
||||
@suppress("Foo", "UNNECESSARY_NOT_NULL_ASSERTION") ""<caret>!!
|
||||
}
|
||||
|
||||
annotation class ann
|
||||
@@ -1,6 +1,6 @@
|
||||
// "Suppress 'UNNECESSARY_NOT_NULL_ASSERTION' for statement " "true"
|
||||
|
||||
fun foo(a: Array<Int>) {
|
||||
[suppress("UNNECESSARY_NOT_NULL_ASSERTION")]
|
||||
@suppress("UNNECESSARY_NOT_NULL_ASSERTION")
|
||||
a[1<caret>!!]
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
// "Suppress 'UNNECESSARY_NOT_NULL_ASSERTION' for statement " "true"
|
||||
|
||||
fun foo() {
|
||||
[suppress("UNNECESSARY_NOT_NULL_ASSERTION")]
|
||||
@suppress("UNNECESSARY_NOT_NULL_ASSERTION")
|
||||
(""<caret>!! as String)
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
// "Suppress 'UNNECESSARY_NOT_NULL_ASSERTION' for statement " "true"
|
||||
|
||||
fun foo() {
|
||||
[suppress("UNNECESSARY_NOT_NULL_ASSERTION")]
|
||||
@suppress("UNNECESSARY_NOT_NULL_ASSERTION")
|
||||
(""<caret>!! as? String)
|
||||
}
|
||||
@@ -3,6 +3,6 @@
|
||||
|
||||
fun foo() {
|
||||
var x = 0
|
||||
[suppress("UNNECESSARY_NOT_NULL_ASSERTION")]
|
||||
@suppress("UNNECESSARY_NOT_NULL_ASSERTION")
|
||||
(x = 1<caret>!!)
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
// "Suppress 'REDUNDANT_NULLABLE' for statement " "true"
|
||||
|
||||
fun foo() {
|
||||
[suppress("REDUNDANT_NULLABLE")]
|
||||
@suppress("REDUNDANT_NULLABLE")
|
||||
call("": String?<caret>?)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// "Suppress 'UNNECESSARY_NOT_NULL_ASSERTION' for statement " "true"
|
||||
|
||||
fun foo() {
|
||||
[suppress("UNNECESSARY_NOT_NULL_ASSERTION")]
|
||||
@suppress("UNNECESSARY_NOT_NULL_ASSERTION")
|
||||
(""<caret>!! : String)
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
// "Suppress 'UNNECESSARY_NOT_NULL_ASSERTION' for statement " "true"
|
||||
|
||||
fun foo() {
|
||||
[suppress("UNNECESSARY_NOT_NULL_ASSERTION")]
|
||||
@suppress("UNNECESSARY_NOT_NULL_ASSERTION")
|
||||
do {}
|
||||
while (true<caret>!!)
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
// "Suppress 'UNNECESSARY_NOT_NULL_ASSERTION' for statement " "true"
|
||||
|
||||
fun foo(a: C) {
|
||||
[suppress("UNNECESSARY_NOT_NULL_ASSERTION")]
|
||||
@suppress("UNNECESSARY_NOT_NULL_ASSERTION")
|
||||
a.foo(""<caret>!!)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// "Suppress 'UNNECESSARY_NOT_NULL_ASSERTION' for statement " "true"
|
||||
|
||||
fun foo() {
|
||||
[suppress("UNNECESSARY_NOT_NULL_ASSERTION")]
|
||||
@suppress("UNNECESSARY_NOT_NULL_ASSERTION")
|
||||
(1<caret>!! ?: 0)
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
// "Suppress 'UNNECESSARY_NOT_NULL_ASSERTION' for statement " "true"
|
||||
|
||||
fun foo() {
|
||||
[suppress("UNNECESSARY_NOT_NULL_ASSERTION")]
|
||||
@suppress("UNNECESSARY_NOT_NULL_ASSERTION")
|
||||
(1<caret>!! == 2)
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
// "Suppress 'UNNECESSARY_NOT_NULL_ASSERTION' for statement " "true"
|
||||
|
||||
fun foo() {
|
||||
[suppress("UNNECESSARY_NOT_NULL_ASSERTION")]
|
||||
@suppress("UNNECESSARY_NOT_NULL_ASSERTION")
|
||||
for (i in list()<caret>!!) {}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// "Suppress 'UNNECESSARY_NOT_NULL_ASSERTION' for statement " "true"
|
||||
|
||||
fun foo() {
|
||||
[suppress("UNNECESSARY_NOT_NULL_ASSERTION")]
|
||||
@suppress("UNNECESSARY_NOT_NULL_ASSERTION")
|
||||
if (true<caret>!!) {}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
// "Suppress 'UNNECESSARY_NOT_NULL_ASSERTION' for statement " "true"
|
||||
|
||||
fun foo() {
|
||||
[suppress("UNNECESSARY_NOT_NULL_ASSERTION")]
|
||||
@suppress("UNNECESSARY_NOT_NULL_ASSERTION")
|
||||
(1<caret>!! in (1..2))
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
// "Suppress 'UNNECESSARY_NOT_NULL_ASSERTION' for statement " "true"
|
||||
|
||||
fun foo() {
|
||||
[suppress("UNNECESSARY_NOT_NULL_ASSERTION")]
|
||||
@suppress("UNNECESSARY_NOT_NULL_ASSERTION")
|
||||
(1<caret>!! plus 2)
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
// "Suppress 'UNNECESSARY_NOT_NULL_ASSERTION' for statement " "true"
|
||||
|
||||
fun foo() {
|
||||
[suppress("UNNECESSARY_NOT_NULL_ASSERTION")]
|
||||
@suppress("UNNECESSARY_NOT_NULL_ASSERTION")
|
||||
(""<caret>!! is String)
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
// "Suppress 'UNNECESSARY_NOT_NULL_ASSERTION' for statement " "true"
|
||||
|
||||
fun foo() {
|
||||
[suppress("UNNECESSARY_NOT_NULL_ASSERTION")]
|
||||
@suppress("UNNECESSARY_NOT_NULL_ASSERTION")
|
||||
label@""<caret>!!
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
// "Suppress 'UNNECESSARY_NOT_NULL_ASSERTION' for statement " "true"
|
||||
|
||||
fun foo() {
|
||||
[suppress("UNNECESSARY_NOT_NULL_ASSERTION")]
|
||||
@suppress("UNNECESSARY_NOT_NULL_ASSERTION")
|
||||
(1<caret>!! < 2)
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
// "Suppress 'UNNECESSARY_NOT_NULL_ASSERTION' for statement " "true"
|
||||
|
||||
fun foo() {
|
||||
[suppress("UNNECESSARY_NOT_NULL_ASSERTION")]
|
||||
@suppress("UNNECESSARY_NOT_NULL_ASSERTION")
|
||||
(1<caret>!! * 2)
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
// "Suppress 'UNNECESSARY_NOT_NULL_ASSERTION' for statement " "true"
|
||||
|
||||
fun foo() {
|
||||
[suppress("UNNECESSARY_NOT_NULL_ASSERTION")]
|
||||
@suppress("UNNECESSARY_NOT_NULL_ASSERTION")
|
||||
(false<caret>!! || true)
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
// "Suppress 'UNNECESSARY_NOT_NULL_ASSERTION' for statement " "true"
|
||||
|
||||
fun foo() {
|
||||
[suppress("UNNECESSARY_NOT_NULL_ASSERTION")]
|
||||
@suppress("UNNECESSARY_NOT_NULL_ASSERTION")
|
||||
(""<caret>!!)
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
// "Suppress 'UNNECESSARY_NOT_NULL_ASSERTION' for statement " "true"
|
||||
|
||||
fun foo() {
|
||||
[suppress("UNNECESSARY_NOT_NULL_ASSERTION")]
|
||||
@suppress("UNNECESSARY_NOT_NULL_ASSERTION")
|
||||
(1<caret>!! + 2)
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
// "Suppress 'UNNECESSARY_NOT_NULL_ASSERTION' for statement " "true"
|
||||
|
||||
fun foo() {
|
||||
[suppress("UNNECESSARY_NOT_NULL_ASSERTION")]
|
||||
@suppress("UNNECESSARY_NOT_NULL_ASSERTION")
|
||||
""<caret>!!
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
fun foo() {
|
||||
var v = Box<String?>()
|
||||
[suppress("REDUNDANT_NULLABLE")]
|
||||
@suppress("REDUNDANT_NULLABLE")
|
||||
(v: Box<String?<caret>?>)++
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
fun foo() {
|
||||
var v = Box<String?>()
|
||||
[suppress("REDUNDANT_NULLABLE")]
|
||||
@suppress("REDUNDANT_NULLABLE")
|
||||
++(v: Box<String?<caret>?>)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// "Suppress 'UNNECESSARY_NOT_NULL_ASSERTION' for statement " "true"
|
||||
|
||||
fun foo() {
|
||||
[suppress("UNNECESSARY_NOT_NULL_ASSERTION")]
|
||||
@suppress("UNNECESSARY_NOT_NULL_ASSERTION")
|
||||
(1<caret>!! .. 2)
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
// "Suppress 'UNNECESSARY_NOT_NULL_ASSERTION' for statement " "true"
|
||||
|
||||
fun foo(): Any {
|
||||
[suppress("UNNECESSARY_NOT_NULL_ASSERTION")]
|
||||
@suppress("UNNECESSARY_NOT_NULL_ASSERTION")
|
||||
return ""<caret>!!
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
// "Suppress 'UNNECESSARY_NOT_NULL_ASSERTION' for statement " "true"
|
||||
|
||||
fun foo(a: C) {
|
||||
[suppress("UNNECESSARY_NOT_NULL_ASSERTION")]
|
||||
@suppress("UNNECESSARY_NOT_NULL_ASSERTION")
|
||||
a?.foo(""<caret>!!)
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,6 @@
|
||||
|
||||
fun foo() {
|
||||
val a = 1
|
||||
[suppress("UNUSED_EXPRESSION")]
|
||||
@suppress("UNUSED_EXPRESSION")
|
||||
a
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
// "Suppress 'UNNECESSARY_NOT_NULL_ASSERTION' for statement " "true"
|
||||
|
||||
fun foo() {
|
||||
[suppress("UNNECESSARY_NOT_NULL_ASSERTION")]
|
||||
@suppress("UNNECESSARY_NOT_NULL_ASSERTION")
|
||||
"${""<caret>!!}"
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
// "Suppress 'UNNECESSARY_NOT_NULL_ASSERTION' for statement " "true"
|
||||
|
||||
fun foo(): Any {
|
||||
[suppress("UNNECESSARY_NOT_NULL_ASSERTION")]
|
||||
@suppress("UNNECESSARY_NOT_NULL_ASSERTION")
|
||||
throw Exception(""<caret>!!)
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
fun foo() {
|
||||
try {
|
||||
[suppress("UNNECESSARY_NOT_NULL_ASSERTION")]
|
||||
@suppress("UNNECESSARY_NOT_NULL_ASSERTION")
|
||||
""<caret>!!
|
||||
}
|
||||
finally {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// "Suppress 'UNNECESSARY_NOT_NULL_ASSERTION' for statement " "true"
|
||||
|
||||
fun foo(a: Any) {
|
||||
[suppress("UNNECESSARY_NOT_NULL_ASSERTION")]
|
||||
@suppress("UNNECESSARY_NOT_NULL_ASSERTION")
|
||||
when (a) {
|
||||
""<caret>!! -> {}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// "Suppress 'UNNECESSARY_NOT_NULL_ASSERTION' for statement " "true"
|
||||
|
||||
fun foo() {
|
||||
[suppress("UNNECESSARY_NOT_NULL_ASSERTION")]
|
||||
@suppress("UNNECESSARY_NOT_NULL_ASSERTION")
|
||||
when (1) {
|
||||
in 1<caret>!!..2 -> {}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// "Suppress 'REDUNDANT_NULLABLE' for statement " "true"
|
||||
|
||||
fun foo() {
|
||||
[suppress("REDUNDANT_NULLABLE")]
|
||||
@suppress("REDUNDANT_NULLABLE")
|
||||
when ("") {
|
||||
is Any?<caret>? -> {}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// "Suppress 'UNNECESSARY_NOT_NULL_ASSERTION' for statement " "true"
|
||||
|
||||
fun foo() {
|
||||
[suppress("UNNECESSARY_NOT_NULL_ASSERTION")]
|
||||
@suppress("UNNECESSARY_NOT_NULL_ASSERTION")
|
||||
when (""<caret>!!) {
|
||||
is Any -> {}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// "Suppress 'UNNECESSARY_NOT_NULL_ASSERTION' for statement " "true"
|
||||
|
||||
fun foo() {
|
||||
[suppress("UNNECESSARY_NOT_NULL_ASSERTION")]
|
||||
@suppress("UNNECESSARY_NOT_NULL_ASSERTION")
|
||||
while (true<caret>!!) {}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
// "Suppress 'UNNECESSARY_NOT_NULL_ASSERTION' for statement " "true"
|
||||
|
||||
fun foo() {
|
||||
[suppress("Foo")] ""<caret>!!
|
||||
@suppress("Foo") ""<caret>!!
|
||||
}
|
||||
|
||||
annotation class ann
|
||||
Reference in New Issue
Block a user