FIR quickfix: Enable addExclExclCall tests for FIR, move typeMismatch
tests for addExclExclCall to addExclExclCall directory.
This commit is contained in:
committed by
Ilya Kirillov
parent
85cbea70bf
commit
71a8d9c0bb
@@ -0,0 +1,5 @@
|
||||
// "Add non-null asserted (!!) call" "true"
|
||||
fun test() {
|
||||
val s: String? = null
|
||||
val z: String = <caret>s
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
// "Add non-null asserted (!!) call" "true"
|
||||
fun test() {
|
||||
val s: String? = null
|
||||
val z: String = s!!
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// "Add non-null asserted (!!) call" "true"
|
||||
|
||||
class C {
|
||||
val s: String? = null
|
||||
}
|
||||
|
||||
// Test for KTIJ-10052
|
||||
fun C.test() {
|
||||
other(<caret>s)
|
||||
}
|
||||
|
||||
fun other(s: String) {}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// "Add non-null asserted (!!) call" "true"
|
||||
|
||||
class C {
|
||||
val s: String? = null
|
||||
}
|
||||
|
||||
// Test for KTIJ-10052
|
||||
fun C.test() {
|
||||
other(s!!)
|
||||
}
|
||||
|
||||
fun other(s: String) {}
|
||||
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
// "Add non-null asserted (!!) call" "true"
|
||||
class C {
|
||||
val s: String? = null
|
||||
}
|
||||
|
||||
// Test for KTIJ-10052
|
||||
fun C.test() {
|
||||
val z: String = <caret>s
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// "Add non-null asserted (!!) call" "true"
|
||||
class C {
|
||||
val s: String? = null
|
||||
}
|
||||
|
||||
// Test for KTIJ-10052
|
||||
fun C.test() {
|
||||
val z: String = s!!
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
// "Add non-null asserted (!!) call" "true"
|
||||
// WITH_RUNTIME
|
||||
|
||||
class A {
|
||||
fun foo(): List<Int?> = listOf()
|
||||
|
||||
fun bar(i : Int, s: String) = Unit
|
||||
|
||||
fun use() {
|
||||
val a = A()
|
||||
a.bar(a.foo().<caret>single(), "Asd")
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
// "Add non-null asserted (!!) call" "true"
|
||||
// WITH_RUNTIME
|
||||
|
||||
class A {
|
||||
fun foo(): List<Int?> = listOf()
|
||||
|
||||
fun bar(i : Int, s: String) = Unit
|
||||
|
||||
fun use() {
|
||||
val a = A()
|
||||
a.bar(a.foo().single()!!, "Asd")
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Add non-null asserted (!!) call" "true"
|
||||
fun test() {
|
||||
val s: String? = null
|
||||
other(<caret>s)
|
||||
}
|
||||
|
||||
fun other(s: String) {}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// "Add non-null asserted (!!) call" "true"
|
||||
fun test() {
|
||||
val s: String? = null
|
||||
other(<caret>s!!)
|
||||
}
|
||||
|
||||
fun other(s: String) {}
|
||||
Vendored
+10
@@ -0,0 +1,10 @@
|
||||
// "class org.jetbrains.kotlin.idea.quickfix.AddExclExclCallFix" "false"
|
||||
// ACTION: Change parameter 's' type of function 'other' to 'String?'
|
||||
// ACTION: Create function 'other'
|
||||
// ERROR: Type mismatch: inferred type is String? but Int was expected
|
||||
fun test() {
|
||||
val s: String? = ""
|
||||
other(<caret>s)
|
||||
}
|
||||
|
||||
fun other(s: Int) {}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// "Add non-null asserted (!!) call" "true"
|
||||
interface Some
|
||||
|
||||
fun <T: Some?> test(t: T) {
|
||||
other(<caret>t)
|
||||
}
|
||||
|
||||
fun other(s: Any) {}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// "Add non-null asserted (!!) call" "true"
|
||||
interface Some
|
||||
|
||||
fun <T: Some?> test(t: T) {
|
||||
other(t!!)
|
||||
}
|
||||
|
||||
fun other(s: Any) {}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
// "Add non-null asserted (!!) call" "true"
|
||||
|
||||
interface A<out T>
|
||||
class B<out T>: A<T>
|
||||
|
||||
open class C
|
||||
open class D: C()
|
||||
|
||||
fun test() {
|
||||
val s: B<D>? = B()
|
||||
other(<caret>s)
|
||||
}
|
||||
|
||||
fun other(s: A<C>) {}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
// "Add non-null asserted (!!) call" "true"
|
||||
|
||||
interface A<out T>
|
||||
class B<out T>: A<T>
|
||||
|
||||
open class C
|
||||
open class D: C()
|
||||
|
||||
fun test() {
|
||||
val s: B<D>? = B()
|
||||
other(<caret>s!!)
|
||||
}
|
||||
|
||||
fun other(s: A<C>) {}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
// "Add non-null asserted (!!) call" "true"
|
||||
// ACTION: Cast expression 'a' to 'Foo'
|
||||
|
||||
interface Foo {
|
||||
fun bar()
|
||||
}
|
||||
|
||||
open class MyClass {
|
||||
open val a: Foo? = null
|
||||
|
||||
fun foo() {
|
||||
if (a != null) {
|
||||
<caret>a.bar()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
// "Add non-null asserted (!!) call" "true"
|
||||
// ACTION: Cast expression 'a' to 'Foo'
|
||||
|
||||
interface Foo {
|
||||
fun bar()
|
||||
}
|
||||
|
||||
open class MyClass {
|
||||
open val a: Foo? = null
|
||||
|
||||
fun foo() {
|
||||
if (a != null) {
|
||||
a!!.bar()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user