J2K: Insert !! for expression only if NotNull expected (not for Default nullability)

This commit is contained in:
Natalia Ukhorskaya
2016-03-29 11:12:53 +03:00
parent 98c3b39f7e
commit 72019a1b4e
3 changed files with 11 additions and 5 deletions
+6 -2
View File
@@ -1,3 +1,7 @@
// ERROR: Type mismatch: inferred type is String? but String was expected
// ERROR: Type mismatch: inferred type is Int? but Int was expected
// ERROR: Type inference failed. Please try to specify type arguments explicitly.
// ERROR: Using 'remove(Int): T' is an error. Use removeAt(index) instead.
package test
import java.util.ArrayList
@@ -16,7 +20,7 @@ class Test {
}
fun test2() {
foo2(myProp!!)
foo2(myProp)
}
fun test3() {
@@ -39,7 +43,7 @@ class Test {
fun test7() {
val list = ArrayList<Int>()
list.remove(myIntProp!!)
list.remove(myIntProp)
}
fun foo1(s: String) {