Update testdata according to change compiler version to 1.4

This commit is contained in:
Dmitriy Novozhilov
2020-01-15 22:13:52 +03:00
parent 5bfb92661e
commit 76b3964e96
39 changed files with 109 additions and 244 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
// FIR_COMPARISON
fun main(args: Array<String>) {
fun main(<warning descr="[UNUSED_PARAMETER] Parameter 'args' is never used">args</warning>: Array<String>) {
String.class<EOLError descr="Name expected"></EOLError>
}
+3 -3
View File
@@ -11,7 +11,7 @@ fun takeFirst(expr: StringBuilder): Char {
fun evaluateArg(expr: CharSequence, numbers: ArrayList<Int>): Int {
if (expr.length == 0) throw Exception("Syntax error: Character expected");
val c = takeFirst(<error>expr</error>)
val c = takeFirst(<error descr="[TYPE_MISMATCH] Type mismatch: inferred type is CharSequence but kotlin.text.StringBuilder /* = java.lang.StringBuilder */ was expected">expr</error>)
if (c >= '0' && c <= '9') {
val n = c - '0'
if (!numbers.contains(n)) throw Exception("You used incorrect number: " + n)
@@ -32,13 +32,13 @@ fun evaluateAdd(expr: StringBuilder, numbers: ArrayList<Int>): Int {
fun evaluate(expr: StringBuilder, numbers: ArrayList<Int>): Int {
val lhs = evaluateAdd(expr, numbers)
if (expr.length > 0) {
val <warning>c</warning> = expr.get(0)
val <warning descr="[UNUSED_VARIABLE] Variable 'c' is never used">c</warning> = expr.get(0)
expr.deleteCharAt(0)
}
return lhs
}
fun main(args: Array<String>) {
fun main(<warning descr="[UNUSED_PARAMETER] Parameter 'args' is never used">args</warning>: Array<String>) {
System.out.println("24 game")
val numbers = ArrayList<Int>(4)
val rnd = Random();
+4 -4
View File
@@ -2,11 +2,11 @@
class Command() {}
fun parse(<warning>cmd</warning>: String): Command? { return null }
fun parse(<warning descr="[UNUSED_PARAMETER] Parameter 'cmd' is never used">cmd</warning>: String): Command? { return null }
fun Any.<warning>equals</warning>(other : Any?) : Boolean = this === other
fun Any.<warning descr="[EXTENSION_SHADOWED_BY_MEMBER] Extension is shadowed by a member: public open operator fun equals(other: Any?): Boolean">equals</warning>(other : Any?) : Boolean = this === other
fun main(args: Array<String>) {
fun main(<warning descr="[UNUSED_PARAMETER] Parameter 'args' is never used">args</warning>: Array<String>) {
val command = parse("")
if (command == null) <warning>1</warning> // error on this line, but must be OK
if (command == null) <warning descr="[UNUSED_EXPRESSION] The expression is unused">1</warning> // error on this line, but must be OK
}
+3 -3
View File
@@ -1,11 +1,11 @@
// FIR_COMPARISON
fun Any.<warning>equals</warning>(<warning>other</warning> : Any?) : Boolean = true
fun Any.<warning descr="[EXTENSION_SHADOWED_BY_MEMBER] Extension is shadowed by a member: public open operator fun equals(other: Any?): Boolean">equals</warning>(<warning descr="[UNUSED_PARAMETER] Parameter 'other' is never used">other</warning> : Any?) : Boolean = true
fun main(args: Array<String>) {
fun main(<warning descr="[UNUSED_PARAMETER] Parameter 'args' is never used">args</warning>: Array<String>) {
val command : Any = 1
command<warning>?.</warning>equals(null)
command<warning descr="[UNNECESSARY_SAFE_CALL] Unnecessary safe call on a non-null receiver of type Any">?.</warning>equals(null)
command.equals(null)
}