Fix suppress at statement intention for asigmnents
There's no need now to consider precedence of element as annotation preceding the beginning of block statement is always now attached to the whole statement #KT-11673 Fixed #KT-12780 Fixed
This commit is contained in:
@@ -2,5 +2,5 @@
|
||||
|
||||
fun foo() {
|
||||
@Suppress("UNNECESSARY_NOT_NULL_ASSERTION")
|
||||
(false<caret>!! && true)
|
||||
false<caret>!! && true
|
||||
}
|
||||
@@ -2,5 +2,5 @@
|
||||
|
||||
fun foo() {
|
||||
@Suppress("UNNECESSARY_NOT_NULL_ASSERTION")
|
||||
(""<caret>!! as String)
|
||||
""<caret>!! as String
|
||||
}
|
||||
@@ -2,5 +2,5 @@
|
||||
|
||||
fun foo() {
|
||||
@Suppress("UNNECESSARY_NOT_NULL_ASSERTION")
|
||||
(""<caret>!! as? String)
|
||||
""<caret>!! as? String
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
// "Suppress 'UNNECESSARY_NOT_NULL_ASSERTION' for statement " "true"
|
||||
// ERROR: Assignments are not expressions, and only expressions are allowed in this context
|
||||
|
||||
fun foo() {
|
||||
var x = 0
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
// "Suppress 'UNNECESSARY_NOT_NULL_ASSERTION' for statement " "true"
|
||||
// ERROR: Assignments are not expressions, and only expressions are allowed in this context
|
||||
|
||||
fun foo() {
|
||||
var x = 0
|
||||
@Suppress("UNNECESSARY_NOT_NULL_ASSERTION")
|
||||
(x = 1<caret>!!)
|
||||
x = 1<caret>!!
|
||||
}
|
||||
@@ -2,5 +2,5 @@
|
||||
|
||||
fun foo() {
|
||||
@Suppress("UNNECESSARY_NOT_NULL_ASSERTION")
|
||||
(1<caret>!! ?: 0)
|
||||
1<caret>!! ?: 0
|
||||
}
|
||||
@@ -2,5 +2,5 @@
|
||||
|
||||
fun foo() {
|
||||
@Suppress("UNNECESSARY_NOT_NULL_ASSERTION")
|
||||
(1<caret>!! == 2)
|
||||
1<caret>!! == 2
|
||||
}
|
||||
@@ -2,5 +2,5 @@
|
||||
|
||||
fun foo() {
|
||||
@Suppress("UNNECESSARY_NOT_NULL_ASSERTION")
|
||||
(1<caret>!! in (1..2))
|
||||
1<caret>!! in (1..2)
|
||||
}
|
||||
@@ -4,5 +4,5 @@ infix fun Int.add(other: Int) = this + other
|
||||
|
||||
fun foo() {
|
||||
@Suppress("UNNECESSARY_NOT_NULL_ASSERTION")
|
||||
(1!! add 2)
|
||||
1!! add 2
|
||||
}
|
||||
@@ -2,5 +2,5 @@
|
||||
|
||||
fun foo() {
|
||||
@Suppress("UNNECESSARY_NOT_NULL_ASSERTION")
|
||||
(""<caret>!! is String)
|
||||
""<caret>!! is String
|
||||
}
|
||||
@@ -2,5 +2,5 @@
|
||||
|
||||
fun foo() {
|
||||
@Suppress("UNNECESSARY_NOT_NULL_ASSERTION")
|
||||
(1<caret>!! < 2)
|
||||
1<caret>!! < 2
|
||||
}
|
||||
@@ -2,5 +2,5 @@
|
||||
|
||||
fun foo() {
|
||||
@Suppress("UNNECESSARY_NOT_NULL_ASSERTION")
|
||||
(1<caret>!! * 2)
|
||||
1<caret>!! * 2
|
||||
}
|
||||
@@ -2,5 +2,5 @@
|
||||
|
||||
fun foo() {
|
||||
@Suppress("UNNECESSARY_NOT_NULL_ASSERTION")
|
||||
(false<caret>!! || true)
|
||||
false<caret>!! || true
|
||||
}
|
||||
@@ -2,5 +2,5 @@
|
||||
|
||||
fun foo() {
|
||||
@Suppress("UNNECESSARY_NOT_NULL_ASSERTION")
|
||||
(1<caret>!! + 2)
|
||||
1<caret>!! + 2
|
||||
}
|
||||
@@ -2,5 +2,5 @@
|
||||
|
||||
fun foo() {
|
||||
@Suppress("UNNECESSARY_NOT_NULL_ASSERTION")
|
||||
(1<caret>!! .. 2)
|
||||
1<caret>!! .. 2
|
||||
}
|
||||
Reference in New Issue
Block a user