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:
Denis Zharkov
2016-10-04 18:04:20 +03:00
parent 7353b08f09
commit 4910024cdb
16 changed files with 17 additions and 22 deletions
@@ -2,5 +2,5 @@
fun foo() {
@Suppress("UNNECESSARY_NOT_NULL_ASSERTION")
(false<caret>!! && true)
false<caret>!! && true
}
+1 -1
View File
@@ -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
}
+1 -1
View File
@@ -2,5 +2,5 @@
fun foo() {
@Suppress("UNNECESSARY_NOT_NULL_ASSERTION")
(1<caret>!! == 2)
1<caret>!! == 2
}
+1 -1
View File
@@ -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
}
+1 -1
View File
@@ -2,5 +2,5 @@
fun foo() {
@Suppress("UNNECESSARY_NOT_NULL_ASSERTION")
(""<caret>!! is String)
""<caret>!! is String
}
+1 -1
View File
@@ -2,5 +2,5 @@
fun foo() {
@Suppress("UNNECESSARY_NOT_NULL_ASSERTION")
(1<caret>!! < 2)
1<caret>!! < 2
}
+1 -1
View File
@@ -2,5 +2,5 @@
fun foo() {
@Suppress("UNNECESSARY_NOT_NULL_ASSERTION")
(1<caret>!! * 2)
1<caret>!! * 2
}
+1 -1
View File
@@ -2,5 +2,5 @@
fun foo() {
@Suppress("UNNECESSARY_NOT_NULL_ASSERTION")
(false<caret>!! || true)
false<caret>!! || true
}
+1 -1
View File
@@ -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
}