Adjust KotlinSuppressIntentionAction to syntax with '@'

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