Fixed tests after adding error checking for intention tests.
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
fun doSomething<T>(a: T) {}
|
||||
|
||||
fun foo() {
|
||||
<caret>do println("test")
|
||||
<caret>do doSomething("test")
|
||||
while(true)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
fun doSomething<T>(a: T) {}
|
||||
|
||||
fun foo() {
|
||||
do {
|
||||
println("test")
|
||||
doSomething("test")
|
||||
} while(true)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
fun doSomething<T>(a: T) {}
|
||||
|
||||
fun foo() {
|
||||
if (true) println("test")
|
||||
<caret>else println("test2")
|
||||
}
|
||||
if (true) doSomething("test")
|
||||
<caret>else doSomething("test2")
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
fun doSomething<T>(a: T) {}
|
||||
|
||||
fun foo() {
|
||||
if (true) println("test")
|
||||
if (true) doSomething("test")
|
||||
else {
|
||||
println("test2")
|
||||
doSomething("test2")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
fun doSomething<T>(a: T) {}
|
||||
|
||||
fun foo() {
|
||||
for (i in 1..4)
|
||||
<caret>println("test")
|
||||
}
|
||||
<caret>doSomething("test")
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
fun doSomething<T>(a: T) {}
|
||||
|
||||
fun foo() {
|
||||
for (i in 1..4) {
|
||||
println("test")
|
||||
doSomething("test")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
fun doSomething<T>(a: T) {}
|
||||
|
||||
fun foo() {
|
||||
<caret>if (true) println("test") else println("test2")
|
||||
}
|
||||
<caret>if (true) doSomething("test") else doSomething("test2")
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
fun doSomething<T>(a: T) {}
|
||||
|
||||
fun foo() {
|
||||
if (true) {
|
||||
println("test")
|
||||
} else println("test2")
|
||||
}
|
||||
doSomething("test")
|
||||
} else doSomething("test2")
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
fun doSomething<T>(a: T) {}
|
||||
|
||||
fun foo() {
|
||||
<caret>if (true)println("test")
|
||||
}
|
||||
<caret>if (true) doSomething("test")
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
fun doSomething<T>(a: T) {}
|
||||
|
||||
fun foo() {
|
||||
if (true) {
|
||||
println("test")
|
||||
doSomething("test")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
fun doSomething<T>(a: T) {}
|
||||
|
||||
fun foo() {
|
||||
<caret>if (true) println("test");
|
||||
}
|
||||
<caret>if (true) doSomething("test");
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
fun doSomething<T>(a: T) {}
|
||||
|
||||
fun foo() {
|
||||
if (true) {
|
||||
println("test")
|
||||
doSomething("test")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
fun doSomething<T>(a: T) {}
|
||||
|
||||
fun foo() {
|
||||
<caret>while (true)
|
||||
println("test")
|
||||
}
|
||||
doSomething("test")
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
fun doSomething<T>(a: T) {}
|
||||
|
||||
fun foo() {
|
||||
while (true) {
|
||||
println("test")
|
||||
doSomething("test")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
// IS_APPLICABLE: false
|
||||
|
||||
fun doSomething<T>(a: T) {}
|
||||
|
||||
fun foo() {
|
||||
<caret>if (true) {
|
||||
println("test")
|
||||
doSomething("test")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+3
-1
@@ -1,7 +1,9 @@
|
||||
fun doSomething<T>(a: T) {}
|
||||
|
||||
fun test() {
|
||||
class Test{
|
||||
fun contains(a: Int) : Boolean = true
|
||||
}
|
||||
val test = Test()
|
||||
println(test.c<caret>ontains(0).toString())
|
||||
doSomething(test.c<caret>ontains(0).toString())
|
||||
}
|
||||
|
||||
+3
-1
@@ -1,7 +1,9 @@
|
||||
fun doSomething<T>(a: T) {}
|
||||
|
||||
fun test() {
|
||||
class Test{
|
||||
fun contains(a: Int) : Boolean = true
|
||||
}
|
||||
val test = Test()
|
||||
println((0 in test).toString())
|
||||
doSomething((0 in test).toString())
|
||||
}
|
||||
|
||||
+3
-1
@@ -1,7 +1,9 @@
|
||||
fun doSomething<T>(a: T) {}
|
||||
|
||||
fun test() {
|
||||
class Test{
|
||||
fun contains(fn: () -> Boolean) : Boolean = true
|
||||
}
|
||||
val test = Test()
|
||||
println(test.c<caret>ontains { true }.toString())
|
||||
doSomething(test.c<caret>ontains { true }.toString())
|
||||
}
|
||||
|
||||
+3
-1
@@ -1,7 +1,9 @@
|
||||
fun doSomething<T>(a: T) {}
|
||||
|
||||
fun test() {
|
||||
class Test{
|
||||
fun contains(fn: () -> Boolean) : Boolean = true
|
||||
}
|
||||
val test = Test()
|
||||
println(({ true } in test).toString())
|
||||
doSomething(({ true } in test).toString())
|
||||
}
|
||||
|
||||
+1
@@ -1,4 +1,5 @@
|
||||
// SHOULD_FAIL_WITH: invalid.arguments
|
||||
// ERROR: Cannot find a parameter with this name: c
|
||||
fun test() {
|
||||
class Test{
|
||||
fun contains(a: Int=1, b: Int=2): Boolean = true
|
||||
|
||||
+1
@@ -1,4 +1,5 @@
|
||||
// SHOULD_FAIL_WITH: duplicate.or.missing.arguments
|
||||
// ERROR: No value passed for parameter b
|
||||
fun test() {
|
||||
class Test{
|
||||
fun contains(a: Int, b: Int): Boolean = true
|
||||
|
||||
+2
@@ -1,4 +1,6 @@
|
||||
// SHOULD_FAIL_WITH: duplicate.or.missing.arguments
|
||||
// ERROR: An argument is already passed for this parameter
|
||||
// ERROR: No value passed for parameter b
|
||||
fun test() {
|
||||
class Test{
|
||||
fun get(a: Int, b: Int) : Int = 0
|
||||
|
||||
+1
@@ -1,4 +1,5 @@
|
||||
// SHOULD_FAIL_WITH: invalid.arguments
|
||||
// ERROR: Cannot find a parameter with this name: c
|
||||
fun test() {
|
||||
class Test{
|
||||
fun get(a: Int=1, b: Int=2) : Int = 0
|
||||
|
||||
+1
@@ -1,4 +1,5 @@
|
||||
// SHOULD_FAIL_WITH: duplicate.or.missing.arguments
|
||||
// ERROR: No value passed for parameter b
|
||||
fun test() {
|
||||
class Test{
|
||||
fun get(a: Int, b: Int) : Int = 0
|
||||
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
fun test() {
|
||||
class Test{
|
||||
fun get(a: Int, b: Int, c: Int = 1, d: Int = 1 fn: (i: Int) -> Int) : Int = 0
|
||||
fun get(a: Int, b: Int, c: Int = 1, d: Int = 1, fn: (i: Int) -> Int) : Int = 0
|
||||
}
|
||||
val test = Test()
|
||||
test.g<caret>et(1, c=3, b=2) { i ->
|
||||
test.g<caret>et(a=1, c=3, b=2, d=4) { i ->
|
||||
i
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
fun test() {
|
||||
class Test{
|
||||
fun get(a: Int, b: Int, c: Int = 1, d: Int = 1 fn: (i: Int) -> Int) : Int = 0
|
||||
fun get(a: Int, b: Int, c: Int = 1, d: Int = 1, fn: (i: Int) -> Int) : Int = 0
|
||||
}
|
||||
val test = Test()
|
||||
test[1, 2, 3, { i ->
|
||||
test[1, 2, 3, 4, { i ->
|
||||
i
|
||||
}]
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// IS_APPLICABLE: false
|
||||
// ERROR: Unresolved reference: got
|
||||
fun test() {
|
||||
class Test{
|
||||
fun get(i: Int) : Int = 0
|
||||
|
||||
+3
-1
@@ -1,7 +1,9 @@
|
||||
fun doSomething<T>(a: T) {}
|
||||
|
||||
fun test() {
|
||||
class Test {
|
||||
fun invoke(a: Int, vararg b: String, fn: () -> Unit): String = "test"
|
||||
}
|
||||
val test = Test()
|
||||
println(test.i<caret>nvoke(1, "a", "b") { })
|
||||
doSomething(test.i<caret>nvoke(1, "a", "b") { })
|
||||
}
|
||||
|
||||
+3
-1
@@ -1,7 +1,9 @@
|
||||
fun doSomething<T>(a: T) {}
|
||||
|
||||
fun test() {
|
||||
class Test {
|
||||
fun invoke(a: Int, vararg b: String, fn: () -> Unit): String = "test"
|
||||
}
|
||||
val test = Test()
|
||||
println(test(1, "a", "b") { })
|
||||
doSomething(test(1, "a", "b") { })
|
||||
}
|
||||
|
||||
+3
-1
@@ -1,3 +1,5 @@
|
||||
fun doSomething<T>(a: T) {}
|
||||
|
||||
fun test() {
|
||||
class Test {
|
||||
fun plus(): Test = Test()
|
||||
@@ -5,5 +7,5 @@ fun test() {
|
||||
fun minus(): Test = Test()
|
||||
}
|
||||
val test = Test()
|
||||
println(-(test + test).pl<caret>us().toString())
|
||||
doSomething((-((test + test).pl<caret>us())).toString())
|
||||
}
|
||||
|
||||
+3
-1
@@ -1,3 +1,5 @@
|
||||
fun doSomething<T>(a: T) {}
|
||||
|
||||
fun test() {
|
||||
class Test {
|
||||
fun plus(): Test = Test()
|
||||
@@ -5,5 +7,5 @@ fun test() {
|
||||
fun minus(): Test = Test()
|
||||
}
|
||||
val test = Test()
|
||||
println(-(+(test + test)).toString())
|
||||
doSomething((-(+(test + test))).toString())
|
||||
}
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
fun foo(): String? {
|
||||
print("foo")
|
||||
return "foo"
|
||||
}
|
||||
|
||||
fun bar() {
|
||||
print("bar")
|
||||
}
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
fun foo(): String? {
|
||||
print("foo")
|
||||
return "foo"
|
||||
}
|
||||
|
||||
fun bar() {
|
||||
print("bar")
|
||||
}
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
fun foo(): String? {
|
||||
print("foo")
|
||||
return "foo"
|
||||
}
|
||||
|
||||
fun bar() {
|
||||
print("bar")
|
||||
}
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
fun foo(): String? {
|
||||
print("foo")
|
||||
return "foo"
|
||||
}
|
||||
|
||||
fun bar() {
|
||||
print("bar")
|
||||
}
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
|
||||
@@ -1,21 +1,23 @@
|
||||
fun doSomething<T>(a: T) {}
|
||||
|
||||
fun test(n: Int): String {
|
||||
var res: String
|
||||
|
||||
if (n == 1) {
|
||||
<caret>if (3 > 2) {
|
||||
println("***")
|
||||
doSomething("***")
|
||||
res = "one"
|
||||
} else {
|
||||
println("***")
|
||||
doSomething("***")
|
||||
res = "???"
|
||||
}
|
||||
} else if (n == 2) {
|
||||
println("***")
|
||||
doSomething("***")
|
||||
res = "two"
|
||||
} else {
|
||||
println("***")
|
||||
doSomething("***")
|
||||
res = "too many"
|
||||
}
|
||||
|
||||
return res
|
||||
}
|
||||
}
|
||||
|
||||
+7
-5
@@ -1,21 +1,23 @@
|
||||
fun doSomething<T>(a: T) {}
|
||||
|
||||
fun test(n: Int): String {
|
||||
var res: String
|
||||
|
||||
if (n == 1) {
|
||||
<caret>res = if (3 > 2) {
|
||||
println("***")
|
||||
doSomething("***")
|
||||
"one"
|
||||
} else {
|
||||
println("***")
|
||||
doSomething("***")
|
||||
"???"
|
||||
}
|
||||
} else if (n == 2) {
|
||||
println("***")
|
||||
doSomething("***")
|
||||
res = "two"
|
||||
} else {
|
||||
println("***")
|
||||
doSomething("***")
|
||||
res = "too many"
|
||||
}
|
||||
|
||||
return res
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
fun doSomething<T>(a: T) {}
|
||||
|
||||
fun test(n: Int): String {
|
||||
var res: String
|
||||
|
||||
<caret>if (n == 1) {
|
||||
println("***")
|
||||
doSomething("***")
|
||||
res = "one"
|
||||
} else {
|
||||
println("***")
|
||||
doSomething("***")
|
||||
res = "two"
|
||||
}
|
||||
|
||||
return res
|
||||
}
|
||||
}
|
||||
|
||||
+5
-3
@@ -1,13 +1,15 @@
|
||||
fun doSomething<T>(a: T) {}
|
||||
|
||||
fun test(n: Int): String {
|
||||
var res: String
|
||||
|
||||
<caret>res = if (n == 1) {
|
||||
println("***")
|
||||
doSomething("***")
|
||||
"one"
|
||||
} else {
|
||||
println("***")
|
||||
doSomething("***")
|
||||
"two"
|
||||
}
|
||||
|
||||
return res
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +1,18 @@
|
||||
// IS_APPLICABLE: false
|
||||
fun doSomething<T>(a: T) {}
|
||||
|
||||
fun test(n: Int): String {
|
||||
var res: String = ""
|
||||
|
||||
<caret>if (n == 1) {
|
||||
println("***")
|
||||
doSomething("***")
|
||||
res = "one"
|
||||
} else {
|
||||
var res: String
|
||||
|
||||
println("***")
|
||||
doSomething("***")
|
||||
res = "two"
|
||||
}
|
||||
|
||||
return res
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
// IS_APPLICABLE: false
|
||||
fun doSomething<T>(a: T) {}
|
||||
|
||||
fun test(n: Int): String {
|
||||
var res: String = ""
|
||||
|
||||
<caret>if (n == 1) {
|
||||
println("***")
|
||||
doSomething("***")
|
||||
res = "one"
|
||||
}
|
||||
|
||||
return res
|
||||
}
|
||||
}
|
||||
|
||||
+5
-3
@@ -1,14 +1,16 @@
|
||||
// IS_APPLICABLE: false
|
||||
fun doSomething<T>(a: T) {}
|
||||
|
||||
fun test(n: Int): String {
|
||||
var res: String
|
||||
|
||||
<caret>if (n == 1) {
|
||||
res = "one"
|
||||
println("***")
|
||||
doSomething("***")
|
||||
} else {
|
||||
println("***")
|
||||
doSomething("***")
|
||||
res = "two"
|
||||
}
|
||||
|
||||
return res
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +1,19 @@
|
||||
fun doSomething<T>(a: T) {}
|
||||
|
||||
fun test(n: Int): String {
|
||||
if (n == 1) {
|
||||
<caret>if (3 > 2) {
|
||||
println("***")
|
||||
doSomething("***")
|
||||
return "one"
|
||||
} else {
|
||||
println("***")
|
||||
doSomething("***")
|
||||
return "???"
|
||||
}
|
||||
} else if (n == 2) {
|
||||
println("***")
|
||||
doSomething("***")
|
||||
return "two"
|
||||
} else {
|
||||
println("***")
|
||||
doSomething("***")
|
||||
return "too many"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +1,19 @@
|
||||
fun doSomething<T>(a: T) {}
|
||||
|
||||
fun test(n: Int): String {
|
||||
if (n == 1) {
|
||||
<caret>return if (3 > 2) {
|
||||
println("***")
|
||||
doSomething("***")
|
||||
"one"
|
||||
} else {
|
||||
println("***")
|
||||
doSomething("***")
|
||||
"???"
|
||||
}
|
||||
} else if (n == 2) {
|
||||
println("***")
|
||||
doSomething("***")
|
||||
return "two"
|
||||
} else {
|
||||
println("***")
|
||||
doSomething("***")
|
||||
return "too many"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
fun doSomething<T>(a: T) {}
|
||||
|
||||
fun test(n: Int): String {
|
||||
<caret>if (n == 1) {
|
||||
println("***")
|
||||
doSomething("***")
|
||||
return "one"
|
||||
} else {
|
||||
println("***")
|
||||
doSomething("***")
|
||||
return "two"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
fun doSomething<T>(a: T) {}
|
||||
|
||||
fun test(n: Int): String {
|
||||
<caret>return if (n == 1) {
|
||||
println("***")
|
||||
doSomething("***")
|
||||
"one"
|
||||
} else {
|
||||
println("***")
|
||||
doSomething("***")
|
||||
"two"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+4
-2
@@ -1,7 +1,9 @@
|
||||
fun doSomething<T>(a: T) {}
|
||||
|
||||
fun test(n: Int): String {
|
||||
<caret>if (n == 1) {
|
||||
println("***")
|
||||
doSomething("***")
|
||||
return "one"
|
||||
}
|
||||
return "two"
|
||||
}
|
||||
}
|
||||
|
||||
+4
-2
@@ -1,6 +1,8 @@
|
||||
fun doSomething<T>(a: T) {}
|
||||
|
||||
fun test(n: Int): String {
|
||||
<caret>return if (n == 1) {
|
||||
println("***")
|
||||
doSomething("***")
|
||||
"one"
|
||||
} else "two"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,21 +1,23 @@
|
||||
fun doSomething<T>(a: T) {}
|
||||
|
||||
fun test(n: Int): String {
|
||||
var res: String
|
||||
|
||||
if (3 > 2) {
|
||||
<caret>when(n) {
|
||||
1 -> {
|
||||
println("***")
|
||||
doSomething("***")
|
||||
res = "one"
|
||||
}
|
||||
else -> {
|
||||
println("***")
|
||||
doSomething("***")
|
||||
res = "two"
|
||||
}
|
||||
}
|
||||
} else {
|
||||
println("***")
|
||||
doSomething("***")
|
||||
res = "???"
|
||||
}
|
||||
|
||||
return res
|
||||
}
|
||||
}
|
||||
|
||||
+6
-4
@@ -1,21 +1,23 @@
|
||||
fun doSomething<T>(a: T) {}
|
||||
|
||||
fun test(n: Int): String {
|
||||
var res: String
|
||||
|
||||
if (3 > 2) {
|
||||
<caret>res = when(n) {
|
||||
1 -> {
|
||||
println("***")
|
||||
doSomething("***")
|
||||
"one"
|
||||
}
|
||||
else -> {
|
||||
println("***")
|
||||
doSomething("***")
|
||||
"two"
|
||||
}
|
||||
}
|
||||
} else {
|
||||
println("***")
|
||||
doSomething("***")
|
||||
res = "???"
|
||||
}
|
||||
|
||||
return res
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +1,18 @@
|
||||
fun doSomething<T>(a: T) {}
|
||||
|
||||
fun test(n: Int): String {
|
||||
var res: String
|
||||
|
||||
<caret>when (n) {
|
||||
1 -> {
|
||||
println("***")
|
||||
doSomething("***")
|
||||
res = "one"
|
||||
}
|
||||
else -> {
|
||||
println("***")
|
||||
doSomething("***")
|
||||
res = "two"
|
||||
}
|
||||
}
|
||||
|
||||
return res
|
||||
}
|
||||
}
|
||||
|
||||
+5
-3
@@ -1,16 +1,18 @@
|
||||
fun doSomething<T>(a: T) {}
|
||||
|
||||
fun test(n: Int): String {
|
||||
var res: String
|
||||
|
||||
<caret>res = when (n) {
|
||||
1 -> {
|
||||
println("***")
|
||||
doSomething("***")
|
||||
"one"
|
||||
}
|
||||
else -> {
|
||||
println("***")
|
||||
doSomething("***")
|
||||
"two"
|
||||
}
|
||||
}
|
||||
|
||||
return res
|
||||
}
|
||||
}
|
||||
|
||||
+5
-3
@@ -1,19 +1,21 @@
|
||||
// IS_APPLICABLE: false
|
||||
fun doSomething<T>(a: T) {}
|
||||
|
||||
fun test(n: Int): String {
|
||||
var res: String = ""
|
||||
|
||||
<caret>when (n) {
|
||||
1 -> {
|
||||
println("***")
|
||||
doSomething("***")
|
||||
res = "one"
|
||||
}
|
||||
else -> {
|
||||
var res: String
|
||||
|
||||
res = "two"
|
||||
println("***")
|
||||
doSomething("***")
|
||||
}
|
||||
}
|
||||
|
||||
return res
|
||||
}
|
||||
}
|
||||
|
||||
+5
-3
@@ -1,18 +1,20 @@
|
||||
// IS_APPLICABLE: false
|
||||
fun doSomething<T>(a: T) {}
|
||||
|
||||
fun test(n: Int): String {
|
||||
var res: String = ""
|
||||
var res2: String = ""
|
||||
|
||||
<caret>when (n) {
|
||||
1 -> {
|
||||
println("***")
|
||||
doSomething("***")
|
||||
res = "one"
|
||||
}
|
||||
else -> {
|
||||
println("***")
|
||||
doSomething("***")
|
||||
res2 = "two"
|
||||
}
|
||||
}
|
||||
|
||||
return res + res2
|
||||
}
|
||||
}
|
||||
|
||||
+5
-3
@@ -1,17 +1,19 @@
|
||||
// IS_APPLICABLE: false
|
||||
fun doSomething<T>(a: T) {}
|
||||
|
||||
fun test(n: Int): String {
|
||||
var res: String
|
||||
|
||||
<caret>when (n) {
|
||||
1 -> {
|
||||
println("***")
|
||||
doSomething("***")
|
||||
res = "one"
|
||||
}
|
||||
else -> {
|
||||
res = "two"
|
||||
println("***")
|
||||
doSomething("***")
|
||||
}
|
||||
}
|
||||
|
||||
return res
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
fun doSomething<T>(a: T) {}
|
||||
|
||||
fun test(n: Int): String {
|
||||
if (3 > 2) {
|
||||
<caret>when (n) {
|
||||
@@ -5,7 +7,7 @@ fun test(n: Int): String {
|
||||
else -> return "two"
|
||||
}
|
||||
} else {
|
||||
println("***")
|
||||
doSomething("***")
|
||||
return "???"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+4
-2
@@ -1,3 +1,5 @@
|
||||
fun doSomething<T>(a: T) {}
|
||||
|
||||
fun test(n: Int): String {
|
||||
if (3 > 2) {
|
||||
<caret>return when (n) {
|
||||
@@ -5,7 +7,7 @@ fun test(n: Int): String {
|
||||
else -> "two"
|
||||
}
|
||||
} else {
|
||||
println("***")
|
||||
doSomething("***")
|
||||
return "???"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
fun doSomething<T>(a: T) {}
|
||||
|
||||
fun test(n: Int): String {
|
||||
<caret>when(n) {
|
||||
1 -> {
|
||||
println("***")
|
||||
doSomething("***")
|
||||
return "one"
|
||||
}
|
||||
else -> {
|
||||
println("***")
|
||||
doSomething("***")
|
||||
return "two"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+5
-3
@@ -1,12 +1,14 @@
|
||||
fun doSomething<T>(a: T) {}
|
||||
|
||||
fun test(n: Int): String {
|
||||
<caret>return when(n) {
|
||||
1 -> {
|
||||
println("***")
|
||||
doSomething("***")
|
||||
"one"
|
||||
}
|
||||
else -> {
|
||||
println("***")
|
||||
doSomething("***")
|
||||
"two"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
// IS_APPLICABLE: false
|
||||
fun doSomething<T>(a: T) {}
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
val foo: String? = null
|
||||
val bar = "bar"
|
||||
|
||||
if (foo != null<caret>) {
|
||||
print ("Hello")
|
||||
doSomething ("Hello")
|
||||
foo
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
// IS_APPLICABLE: false
|
||||
fun <T> T.compareTo(a: T): Int = 0
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
val foo = null
|
||||
val bar = "bar"
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
// IS_APPLICABLE: false
|
||||
// ERROR: <html>Type mismatch.<table><tr><td>Required:</td><td>kotlin.Boolean</td></tr><tr><td>Found:</td><td>kotlin.Int</td></tr></table></html>
|
||||
// ERROR: Condition must be of type kotlin.Boolean, but is of type kotlin.Int
|
||||
// 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
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
val foo: Int? = 4
|
||||
val bar = 3
|
||||
|
||||
+3
-1
@@ -1,10 +1,12 @@
|
||||
fun doSomething<T>(a: T) {}
|
||||
|
||||
fun maybeFoo(): String? {
|
||||
return "foo"
|
||||
}
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
val foo = maybeFoo()
|
||||
print(foo)
|
||||
doSomething(foo)
|
||||
val bar = "bar"
|
||||
if (foo != null<caret>) {
|
||||
foo
|
||||
|
||||
+3
-1
@@ -1,10 +1,12 @@
|
||||
fun doSomething<T>(a: T) {}
|
||||
|
||||
fun maybeFoo(): String? {
|
||||
return "foo"
|
||||
}
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
val foo = maybeFoo()
|
||||
print(foo)
|
||||
doSomething(foo)
|
||||
val bar = "bar"
|
||||
foo ?: bar
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
// IS_APPLICABLE: false
|
||||
// ERROR: <html>Type mismatch.<table><tr><td>Required:</td><td>kotlin.Boolean</td></tr><tr><td>Found:</td><td>() → kotlin.String?</td></tr></table></html>
|
||||
// ERROR: Condition must be of type kotlin.Boolean, but is of type () -> kotlin.String?
|
||||
fun main(args: Array<String>) {
|
||||
val foo: String? = "foo"
|
||||
val bar = "bar"
|
||||
|
||||
+3
-1
@@ -1,4 +1,6 @@
|
||||
// IS_APPLICABLE: false
|
||||
fun doSomething<T>(a: T) {}
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
val foo: String? = null
|
||||
val bar = "bar"
|
||||
@@ -7,7 +9,7 @@ fun main(args: Array<String>) {
|
||||
foo
|
||||
}
|
||||
else {
|
||||
print ("Hello")
|
||||
doSomething("Hello")
|
||||
bar
|
||||
}
|
||||
}
|
||||
|
||||
+3
-1
@@ -1,8 +1,10 @@
|
||||
// IS_APPLICABLE: false
|
||||
fun doSomething<T>(a: T) {}
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
val foo: String? = "abc"
|
||||
if (foo != null<caret>) {
|
||||
print ("Hello")
|
||||
doSomething ("Hello")
|
||||
foo.length
|
||||
}
|
||||
else null
|
||||
|
||||
@@ -3,7 +3,7 @@ fun main(args: Array<String>) {
|
||||
var foo: String? = "foo"
|
||||
var bar: String? = "bar"
|
||||
if (foo != null<caret>) {
|
||||
bar.length
|
||||
bar?.length
|
||||
}
|
||||
else null
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
// IS_APPLICABLE: false
|
||||
fun <T> T.compareTo(a: T): Int = 0
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
val foo = "foo"
|
||||
if (foo > null<caret>) {
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
// IS_APPLICABLE: false
|
||||
fun String?.times(a: Int): Boolean = a == 0
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
val foo: String = "foo"
|
||||
if (foo * 10<caret>) {
|
||||
|
||||
+4
-2
@@ -2,11 +2,13 @@ fun maybeFoo(): String? {
|
||||
return "foo"
|
||||
}
|
||||
|
||||
fun doSomething<T>(a: T) {}
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
val foo = maybeFoo()
|
||||
print(foo)
|
||||
doSomething(foo)
|
||||
if (foo != null<caret>) {
|
||||
foo.length()
|
||||
foo.length
|
||||
}
|
||||
else {
|
||||
null
|
||||
|
||||
+4
-2
@@ -2,8 +2,10 @@ fun maybeFoo(): String? {
|
||||
return "foo"
|
||||
}
|
||||
|
||||
fun doSomething<T>(a: T) {}
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
val foo = maybeFoo()
|
||||
print(foo)
|
||||
foo?.length()
|
||||
doSomething(foo)
|
||||
foo?.length
|
||||
}
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ val x = maybeFoo()
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
if (x !=<caret> null) {
|
||||
x.length()
|
||||
x.length
|
||||
} else {
|
||||
null
|
||||
}
|
||||
|
||||
+1
-1
@@ -5,5 +5,5 @@ fun maybeFoo(): String? {
|
||||
val x = maybeFoo()
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
x?.length()
|
||||
x?.length
|
||||
}
|
||||
|
||||
@@ -7,6 +7,6 @@ fun main(args: Array<String>) {
|
||||
if (foo == null<caret>) {
|
||||
}
|
||||
else {
|
||||
foo.length()
|
||||
foo.length
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,5 +3,5 @@ fun maybeFoo(): String? {
|
||||
}
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
maybeFoo()?.length()
|
||||
maybeFoo()?.length
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ fun maybeFoo(): String? {
|
||||
fun main(args: Array<String>) {
|
||||
val foo = maybeFoo()
|
||||
if (foo != null<caret>) {
|
||||
foo.length()
|
||||
foo.length
|
||||
}
|
||||
else {
|
||||
null
|
||||
|
||||
@@ -3,5 +3,5 @@ fun maybeFoo(): String? {
|
||||
}
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
maybeFoo()?.length()
|
||||
maybeFoo()?.length
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ fun maybeFoo(): String? {
|
||||
fun main(args: Array<String>) {
|
||||
val foo = maybeFoo()
|
||||
if (foo != null<caret>)
|
||||
foo.length()
|
||||
foo.length
|
||||
else
|
||||
null
|
||||
}
|
||||
|
||||
@@ -3,5 +3,5 @@ fun maybeFoo(): String? {
|
||||
}
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
maybeFoo()?.length()
|
||||
maybeFoo()?.length
|
||||
}
|
||||
|
||||
@@ -7,5 +7,5 @@ fun main(args: Array<String>) {
|
||||
if (foo == null<caret>)
|
||||
null
|
||||
else
|
||||
foo.length()
|
||||
foo.length
|
||||
}
|
||||
|
||||
@@ -3,5 +3,5 @@ fun maybeFoo(): String? {
|
||||
}
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
maybeFoo()?.length()
|
||||
maybeFoo()?.length
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ fun maybeFoo(): String? {
|
||||
fun main(args: Array<String>) {
|
||||
val foo = maybeFoo()
|
||||
if (foo != null<caret>)
|
||||
foo.length()
|
||||
foo.length
|
||||
else
|
||||
null
|
||||
}
|
||||
|
||||
@@ -3,5 +3,5 @@ fun maybeFoo(): String? {
|
||||
}
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
maybeFoo()?.length()
|
||||
maybeFoo()?.length
|
||||
}
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
// IS_APPLICABLE: false
|
||||
// ERROR: <html>Type mismatch.<table><tr><td>Required:</td><td>kotlin.Boolean</td></tr><tr><td>Found:</td><td>() → kotlin.Int</td></tr></table></html>
|
||||
// ERROR: Condition must be of type kotlin.Boolean, but is of type () -> kotlin.Int
|
||||
// ERROR: Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type kotlin.String?
|
||||
fun main(args: Array<String>) {
|
||||
val foo: String? = "foo"
|
||||
if<caret> {
|
||||
foo.length()
|
||||
foo.length
|
||||
} else null
|
||||
}
|
||||
|
||||
@@ -5,6 +5,6 @@ fun maybeFoo(): String? {
|
||||
fun main(args: Array<String>) {
|
||||
val foo = maybeFoo()
|
||||
if (foo != null<caret>) {
|
||||
foo.length()
|
||||
foo.length
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,5 +3,5 @@ fun maybeFoo(): String? {
|
||||
}
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
maybeFoo()?.length()
|
||||
maybeFoo()?.length
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ fun main(args: Array<String>) {
|
||||
val foo: String? = "foo"
|
||||
val bar: String? = null
|
||||
if (foo == bar<caret>) {
|
||||
foo.length()
|
||||
foo?.length
|
||||
}
|
||||
else null
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ fun main(args: Array<String>) {
|
||||
val foo: String? = "foo"
|
||||
val bar: String? = null
|
||||
if (foo == bar<caret>) {
|
||||
bar.length()
|
||||
bar?.length
|
||||
}
|
||||
else null
|
||||
}
|
||||
|
||||
@@ -5,6 +5,6 @@ fun maybeFoo(): String? {
|
||||
fun main(args: Array<String>) {
|
||||
val foo = maybeFoo()
|
||||
if (foo == null<caret>) else {
|
||||
foo.length()
|
||||
foo.length
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,5 +3,5 @@ fun maybeFoo(): String? {
|
||||
}
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
maybeFoo()?.length()
|
||||
maybeFoo()?.length
|
||||
}
|
||||
|
||||
@@ -7,5 +7,5 @@ fun main(args: Array<String>) {
|
||||
if (maybeFoo() == null<caret>)
|
||||
null
|
||||
else
|
||||
maybeFoo().length()
|
||||
maybeFoo()?.length
|
||||
}
|
||||
|
||||
@@ -8,5 +8,5 @@ fun main(args: Array<String>) {
|
||||
if (foo == null<caret>)
|
||||
null
|
||||
else
|
||||
foo.length()
|
||||
foo?.length
|
||||
}
|
||||
|
||||
+3
-1
@@ -1,11 +1,13 @@
|
||||
// IS_APPLICABLE: false
|
||||
fun doSomething<T>(a: T) {}
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
val foo: String? = "abc"
|
||||
if (foo != null<caret>) {
|
||||
foo.length
|
||||
}
|
||||
else {
|
||||
print("Hi")
|
||||
doSomething("Hi")
|
||||
null
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,5 +7,5 @@ fun main(args: Array<String>) {
|
||||
if (null == foo<caret>)
|
||||
null
|
||||
else
|
||||
foo.length()
|
||||
foo.length
|
||||
}
|
||||
|
||||
@@ -3,5 +3,5 @@ fun maybeFoo(): String? {
|
||||
}
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
maybeFoo()?.length()
|
||||
maybeFoo()?.length
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ fun maybeFoo(): String? {
|
||||
fun main(args: Array<String>) {
|
||||
val foo = maybeFoo()
|
||||
if (null != foo<caret>)
|
||||
foo.length()
|
||||
foo.length
|
||||
else
|
||||
null
|
||||
}
|
||||
|
||||
@@ -3,5 +3,5 @@ fun maybeFoo(): String? {
|
||||
}
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
maybeFoo()?.length()
|
||||
maybeFoo()?.length
|
||||
}
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
// IS_APPLICABLE: false
|
||||
// ERROR: Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type kotlin.String?
|
||||
fun main(args: Array<String>) {
|
||||
val foo: String? = "foo"
|
||||
if (foo == null<caret>) {
|
||||
foo.length()
|
||||
foo.length
|
||||
}
|
||||
else {
|
||||
foo.length()
|
||||
foo.length
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
class Klass<T>
|
||||
|
||||
fun test(obj: Any): String {
|
||||
return <caret>if (obj is String)
|
||||
"string"
|
||||
else if (obj is Int)
|
||||
"int"
|
||||
else if (obj is Class<*>)
|
||||
else if (obj is Klass<*>)
|
||||
"class"
|
||||
else "unknown"
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user