Protection against "<caret>" missing in test data
Many incorrect tests fixed
This commit is contained in:
+1
-1
@@ -2,5 +2,5 @@
|
||||
// ERROR: Unresolved reference: TTT
|
||||
|
||||
class {
|
||||
val t: TTT = null
|
||||
val t: <caret>TTT = null
|
||||
}
|
||||
|
||||
+1
-1
@@ -3,5 +3,5 @@
|
||||
// ERROR: Function declaration must have a name
|
||||
|
||||
fun () {
|
||||
val tttt : TTTTT = null
|
||||
val tttt : <caret>TTTTT = null
|
||||
}
|
||||
|
||||
+1
-1
@@ -2,5 +2,5 @@
|
||||
// ERROR: Unresolved reference: TTT
|
||||
|
||||
object {
|
||||
val t : TTT = null
|
||||
val t : <caret>TTT = null
|
||||
}
|
||||
+1
-1
@@ -2,5 +2,5 @@
|
||||
// ERROR: Unresolved reference: TTT
|
||||
|
||||
fun f(: Int) {
|
||||
val t: TTT = null
|
||||
val t: <caret>TTT = null
|
||||
}
|
||||
+1
-1
@@ -3,6 +3,6 @@
|
||||
|
||||
val : Int
|
||||
get() {
|
||||
val t : TTT = null
|
||||
val t : <caret>TTT = null
|
||||
return 1
|
||||
}
|
||||
@@ -1,4 +1,12 @@
|
||||
// "Create function" "false"
|
||||
// ACTION: Create extension function 'Collection<List<String>>.firstOrNull'
|
||||
// ACTION: Create extension function 'Unit.equals'
|
||||
// ACTION: Create local variable 'maximumSizeOfGroup'
|
||||
// ACTION: Create object 'maximumSizeOfGroup'
|
||||
// ACTION: Create parameter 'maximumSizeOfGroup'
|
||||
// ACTION: Create property 'maximumSizeOfGroup'
|
||||
// ACTION: Introduce local variable
|
||||
// ACTION: Rename reference
|
||||
// ERROR: A 'return' expression required in a function with a block body ('{...}')
|
||||
// ERROR: The expression cannot be a selector (occur after a dot)
|
||||
// ERROR: Type inference failed: inline fun <T> Iterable<T>.firstOrNull(predicate: (T) -> Boolean): T?<br>cannot be applied to<br>receiver: Collection<List<String>> arguments: ((List<String>) -> () -> Boolean)<br>
|
||||
@@ -9,5 +17,5 @@ fun doSomethingStrangeWithCollection(collection: Collection<String>): Collection
|
||||
val groupsByLength = collection.groupBy { s -> { s.length } }
|
||||
|
||||
val maximumSizeOfGroup = groupsByLength.values.maxBy { it.size }.
|
||||
return groupsByLength.values.firstOrNull { group -> {group.size == maximumSizeOfGroup} }
|
||||
return groupsByLength.values.firstOrNull { group -> {group.size == <caret>maximumSizeOfGroup} }
|
||||
}
|
||||
|
||||
+2
-1
@@ -1,3 +1,4 @@
|
||||
// "Create subclass" "false"
|
||||
// ACTION: Create test
|
||||
|
||||
class Base
|
||||
class <caret>Base
|
||||
@@ -1,3 +1,4 @@
|
||||
// "class org.jetbrains.kotlin.idea.intentions.CreateKotlinSubClassIntention" "false"
|
||||
// ACTION: Create test
|
||||
|
||||
abstract class Base(val x: Int)
|
||||
abstract class <caret>Base(val x: Int)
|
||||
+2
-1
@@ -1,3 +1,4 @@
|
||||
// "class org.jetbrains.kotlin.idea.intentions.CreateKotlinSubClassIntention" "false"
|
||||
// ACTION: Create test
|
||||
|
||||
abstract class Base private constructor
|
||||
abstract class <caret>Base private constructor
|
||||
Vendored
+1
-1
@@ -9,5 +9,5 @@ interface B {
|
||||
}
|
||||
|
||||
interface C : A, B {
|
||||
override fun foo(): Long
|
||||
override fun foo(): <caret>Long
|
||||
}
|
||||
|
||||
@@ -2,6 +2,6 @@
|
||||
|
||||
enum class E {
|
||||
A {
|
||||
fun foo(): String?? = null
|
||||
fun foo(): String??<caret> = null
|
||||
}
|
||||
}
|
||||
@@ -2,5 +2,5 @@
|
||||
|
||||
fun foo() {
|
||||
val a = 1
|
||||
a
|
||||
<caret>a
|
||||
}
|
||||
@@ -1,7 +1,10 @@
|
||||
// "Specify type explicitly" "false"
|
||||
// ERROR: This property must either have a type annotation, be initialized or be delegated
|
||||
// ACTION: Convert member to extension
|
||||
// ACTION: Convert property to function
|
||||
// ACTION: Move to companion object
|
||||
|
||||
class A {
|
||||
val a
|
||||
val a<caret>
|
||||
get() = a
|
||||
}
|
||||
@@ -1,8 +1,9 @@
|
||||
// "Cast expression 'Foo<Number>()' to 'Foo<Int>'" "false"
|
||||
// ACTION: Create test
|
||||
// ACTION: Change 'foo' function return type to 'Foo<Number>'
|
||||
// ACTION: Convert to expression body
|
||||
// ERROR: Type mismatch: inferred type is Foo<Number> but Foo<Int> was expected
|
||||
class Foo<T>
|
||||
|
||||
fun foo(): Foo<Int> {
|
||||
return Foo<Number>()
|
||||
return <caret>Foo<Number>()
|
||||
}
|
||||
@@ -1,12 +1,16 @@
|
||||
// "???" "false"
|
||||
//ERROR: Type mismatch: inferred type is Array<out Int> but Array<out String> was expected
|
||||
// ERROR: Type mismatch: inferred type is Array<out Int> but Array<out String> was expected
|
||||
// ACTION: Change parameter 't' type of function 'join' to 'Array<out Int>'
|
||||
// ACTION: Create function 'join'
|
||||
// ACTION: Flip ','
|
||||
// ACTION: Introduce local variable
|
||||
|
||||
//this test checks that there is no ArrayIndexOutOfBoundsException when there are more arguments than parameters
|
||||
fun <T> array1(vararg a : T) = a
|
||||
|
||||
fun main(args : Array<String>) {
|
||||
val b = array1(1, 1)
|
||||
join(1, "4", *b, "3")
|
||||
join(1, "4", *b<caret>, "3")
|
||||
}
|
||||
|
||||
fun join(x : Int, vararg t : String) : String = "$x$t"
|
||||
|
||||
Reference in New Issue
Block a user