Fix 'add not-null asserted call' quick fix for operation in

#KT-18529 Fixed
This commit is contained in:
Mikhail Zarechenskiy
2017-06-19 04:06:05 +03:00
parent b53a3b324f
commit aeac2ea384
12 changed files with 33 additions and 13 deletions
@@ -2,7 +2,7 @@
// IS_APPLICABLE: false
// ERROR: Type mismatch: inferred type is Int but Boolean was expected
// ERROR: Type mismatch: inferred type is Int but Boolean was expected
// ERROR: Infix call corresponds to a dot-qualified call 'foo.times(10)' which is not allowed on a nullable receiver 'foo'. Use '?.'-qualified call instead
// ERROR: Operator call corresponds to a dot-qualified call 'foo.times(10)' which is not allowed on a nullable receiver 'foo'.
fun String?.times(a: Int): Boolean = a == 0
@@ -1,7 +1,7 @@
// IS_APPLICABLE: false
// ERROR: Type mismatch: inferred type is Int but Boolean was expected
// ERROR: Type mismatch: inferred type is Int but Boolean was expected
// ERROR: Infix call corresponds to a dot-qualified call 'foo.times(10)' which is not allowed on a nullable receiver 'foo'. Use '?.'-qualified call instead
// ERROR: Operator call corresponds to a dot-qualified call 'foo.times(10)' which is not allowed on a nullable receiver 'foo'.
fun main(args: Array<String>) {
val foo: Int? = 4
@@ -1,5 +1,5 @@
// IS_APPLICABLE: false
// ERROR: Infix call corresponds to a dot-qualified call 'nullable?.compareTo(1).compareTo(0)' which is not allowed on a nullable receiver 'nullable?.compareTo(1)'. Use '?.'-qualified call instead
// ERROR: Operator call corresponds to a dot-qualified call 'nullable?.compareTo(1).compareTo(0)' which is not allowed on a nullable receiver 'nullable?.compareTo(1)'.
val nullable: Int? = null
val x = nullable?.compareTo<caret>(1) >= 0