[FIR] Fix tests (ARGUMENT_TYPE_MISMATCH instead of INCOMPATIBLE_CANDIDATE)
This commit is contained in:
committed by
TeamCityServer
parent
4ffab5fe5a
commit
ad9b962536
+8
-8
@@ -1,32 +1,32 @@
|
||||
annotation class A(val i: Int)
|
||||
annotation class Z(val i: Int)
|
||||
|
||||
<error descr="[INAPPLICABLE_CANDIDATE] Inapplicable candidate(s): /Z.Z">@Z("BAD")</error> @Suppress("TYPE_MISMATCH")
|
||||
@Z(<error descr="[ARGUMENT_TYPE_MISMATCH] Argument type mismatch: actual type is kotlin/String but kotlin/Int was expected">"BAD"</error>) @Suppress("TYPE_MISMATCH")
|
||||
fun some0() {}
|
||||
|
||||
<error descr="[INAPPLICABLE_CANDIDATE] Inapplicable candidate(s): /Z.Z">@Z("BAD")</error> <error descr="[INAPPLICABLE_CANDIDATE] Inapplicable candidate(s): /Z.Z">@Z("BAD")</error> @Suppress("TYPE_MISMATCH")
|
||||
@Z(<error descr="[ARGUMENT_TYPE_MISMATCH] Argument type mismatch: actual type is kotlin/String but kotlin/Int was expected">"BAD"</error>) @Z(<error descr="[ARGUMENT_TYPE_MISMATCH] Argument type mismatch: actual type is kotlin/String but kotlin/Int was expected">"BAD"</error>) @Suppress("TYPE_MISMATCH")
|
||||
fun some01() {}
|
||||
|
||||
@Suppress("TYPE_MISMATCH") <error descr="[INAPPLICABLE_CANDIDATE] Inapplicable candidate(s): /Z.Z">@Z("BAD")</error>
|
||||
@Suppress("TYPE_MISMATCH") @Z(<error descr="[ARGUMENT_TYPE_MISMATCH] Argument type mismatch: actual type is kotlin/String but kotlin/Int was expected">"BAD"</error>)
|
||||
fun some1() {
|
||||
}
|
||||
|
||||
@Suppress("TYPE_MISMATCH") <error descr="[INAPPLICABLE_CANDIDATE] Inapplicable candidate(s): /Z.Z">@Z("BAD")</error> <error descr="[INAPPLICABLE_CANDIDATE] Inapplicable candidate(s): /Z.Z">@Z("BAD")</error>
|
||||
@Suppress("TYPE_MISMATCH") @Z(<error descr="[ARGUMENT_TYPE_MISMATCH] Argument type mismatch: actual type is kotlin/String but kotlin/Int was expected">"BAD"</error>) @Z(<error descr="[ARGUMENT_TYPE_MISMATCH] Argument type mismatch: actual type is kotlin/String but kotlin/Int was expected">"BAD"</error>)
|
||||
fun some11() {
|
||||
}
|
||||
|
||||
<error descr="[INAPPLICABLE_CANDIDATE] Inapplicable candidate(s): /A.A">@A("BAD")</error> @Suppress("TYPE_MISMATCH")
|
||||
@A(<error descr="[ARGUMENT_TYPE_MISMATCH] Argument type mismatch: actual type is kotlin/String but kotlin/Int was expected">"BAD"</error>) @Suppress("TYPE_MISMATCH")
|
||||
fun some2() {
|
||||
}
|
||||
|
||||
@Suppress("TYPE_MISMATCH") <error descr="[INAPPLICABLE_CANDIDATE] Inapplicable candidate(s): /A.A">@A("BAD")</error>
|
||||
@Suppress("TYPE_MISMATCH") @A(<error descr="[ARGUMENT_TYPE_MISMATCH] Argument type mismatch: actual type is kotlin/String but kotlin/Int was expected">"BAD"</error>)
|
||||
fun some3() {
|
||||
}
|
||||
|
||||
<error descr="[INAPPLICABLE_CANDIDATE] Inapplicable candidate(s): /A.A">@A("BAD")</error> <error descr="[INAPPLICABLE_CANDIDATE] Inapplicable candidate(s): /A.A">@A("BAD")</error>
|
||||
@A(<error descr="[ARGUMENT_TYPE_MISMATCH] Argument type mismatch: actual type is kotlin/String but kotlin/Int was expected">"BAD"</error>) @A(<error descr="[ARGUMENT_TYPE_MISMATCH] Argument type mismatch: actual type is kotlin/String but kotlin/Int was expected">"BAD"</error>)
|
||||
fun some4() {
|
||||
}
|
||||
|
||||
<error descr="[INAPPLICABLE_CANDIDATE] Inapplicable candidate(s): /Z.Z">@Z("BAD")</error>
|
||||
@Z(<error descr="[ARGUMENT_TYPE_MISMATCH] Argument type mismatch: actual type is kotlin/String but kotlin/Int was expected">"BAD"</error>)
|
||||
fun someN() {
|
||||
}
|
||||
|
||||
-10
@@ -1,10 +0,0 @@
|
||||
fun <T> checkSubtype(t: T) = t
|
||||
|
||||
fun test() {
|
||||
checkSubtype<Byte>(1)
|
||||
checkSubtype<Int>(1)
|
||||
<error descr="[INAPPLICABLE_CANDIDATE] Inapplicable candidate(s): /checkSubtype">checkSubtype</error><Double>(1)
|
||||
1 as Byte
|
||||
1 as Int
|
||||
1 as Double
|
||||
}
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
fun <T> checkSubtype(t: T) = t
|
||||
|
||||
fun test() {
|
||||
|
||||
+2
-2
@@ -56,8 +56,8 @@ fun <T> test2(t : T)
|
||||
t.bar()
|
||||
}
|
||||
|
||||
val t1 = <error descr="[INAPPLICABLE_CANDIDATE] Inapplicable candidate(s): Jet87/test2">test2</error><A>(A())
|
||||
val t2 = <error descr="[INAPPLICABLE_CANDIDATE] Inapplicable candidate(s): Jet87/test2">test2</error><B>(C())
|
||||
val t1 = test2<A>(<error descr="[ARGUMENT_TYPE_MISMATCH] Argument type mismatch: actual type is Jet87/A but T was expected">A()</error>)
|
||||
val t2 = test2<B>(<error descr="[ARGUMENT_TYPE_MISMATCH] Argument type mismatch: actual type is Jet87/C but T was expected">C()</error>)
|
||||
val t3 = test2<C>(C())
|
||||
|
||||
val <T, B: T> Pair<T, B>.x : Int get() = 0
|
||||
|
||||
+2
-2
@@ -3,8 +3,8 @@ package test
|
||||
|
||||
annotation class A(val value: String)
|
||||
|
||||
<error descr="[INAPPLICABLE_CANDIDATE] Inapplicable candidate(s): test/A.A">@A(null)</error>
|
||||
@A(<error descr="[ARGUMENT_TYPE_MISMATCH] Argument type mismatch: actual type is kotlin/Nothing? but kotlin/String was expected">null</error>)
|
||||
fun foo() {}
|
||||
|
||||
<error descr="[INAPPLICABLE_CANDIDATE] Inapplicable candidate(s): test/A.A">@A(null)</error>
|
||||
@A(<error descr="[ARGUMENT_TYPE_MISMATCH] Argument type mismatch: actual type is kotlin/Nothing? but kotlin/String was expected">null</error>)
|
||||
class B
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ fun test(l : List<Int>) {
|
||||
Collections.emptyList()
|
||||
|
||||
checkSubtype<Set<Int>?>(Collections.singleton<Int>(1))
|
||||
Collections.<error descr="[INAPPLICABLE_CANDIDATE] Inapplicable candidate(s): java/util/Collections.singleton">singleton</error><Int>(1.0)
|
||||
Collections.singleton<Int>(<error descr="[ARGUMENT_TYPE_MISMATCH] Argument type mismatch: actual type is kotlin/Double but ft<TypeVariable(T), TypeVariable(T)?> was expected">1.0</error>)
|
||||
|
||||
List<Int>
|
||||
|
||||
|
||||
+2
-2
@@ -32,9 +32,9 @@ fun <T> copy3(from : Array<out T>, to : Array<in T>) {}
|
||||
fun copy4(from : Array<out Number>, to : Array<in Int>) {}
|
||||
|
||||
fun f(ints: Array<Int>, any: Array<Any>, numbers: Array<Number>) {
|
||||
<error descr="[INAPPLICABLE_CANDIDATE] Inapplicable candidate(s): variance/copy1">copy1</error>(ints, any)
|
||||
copy1(<error descr="[ARGUMENT_TYPE_MISMATCH] Argument type mismatch: actual type is variance/Array<kotlin/Int> but variance/Array<kotlin/Any> was expected">ints</error>, any)
|
||||
copy2(ints, any) //ok
|
||||
<error descr="[INAPPLICABLE_CANDIDATE] Inapplicable candidate(s): variance/copy2">copy2</error>(ints, numbers)
|
||||
copy2(ints, <error descr="[ARGUMENT_TYPE_MISMATCH] Argument type mismatch: actual type is variance/Array<kotlin/Number> but variance/Array<in kotlin/Any> was expected">numbers</error>)
|
||||
copy3<Int>(ints, numbers)
|
||||
copy4(ints, numbers) //ok
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// COMPILER_ARGUMENTS: -XXLanguage:-NewInference
|
||||
|
||||
val f = listOf("").<error descr="[INAPPLICABLE_CANDIDATE] Inapplicable candidate(s): /firstOrNull">firstOrNull</error>(1)
|
||||
val f = listOf("").firstOrNull(<error descr="[ARGUMENT_TYPE_MISMATCH] Argument type mismatch: actual type is kotlin/Int but kotlin/Function1<TypeVariable(T), kotlin/Boolean> was expected">1</error>)
|
||||
|
||||
fun <T> listOf(element: T): List<T> = java.util.Collections.singletonList(element)
|
||||
fun <T> Iterable<T>.firstOrNull(predicate: (T) -> Boolean): T? = null
|
||||
fun <T> Iterable<T>.firstOrNull(<warning>predicate</warning>: (T) -> Boolean): T? = null
|
||||
+2
-2
@@ -196,11 +196,11 @@ fun returnFunctionLiteral(a: Any?): Function0<Int> =
|
||||
|
||||
fun mergeSmartCasts(a: Any?) {
|
||||
if (a is String || a is Int) {
|
||||
a.<error descr="[INAPPLICABLE_CANDIDATE] Inapplicable candidate(s): kotlin/Comparable.compareTo">compareTo</error>("")
|
||||
a.compareTo(<error descr="[ARGUMENT_TYPE_MISMATCH] Argument type mismatch: actual type is kotlin/String but it(kotlin/String & kotlin/Int) was expected">""</error>)
|
||||
a.toString()
|
||||
}
|
||||
if (a is Int || a is String) {
|
||||
a.<error descr="[INAPPLICABLE_CANDIDATE] Inapplicable candidate(s): kotlin/Comparable.compareTo">compareTo</error>("")
|
||||
a.compareTo(<error descr="[ARGUMENT_TYPE_MISMATCH] Argument type mismatch: actual type is kotlin/String but it(kotlin/Int & kotlin/String) was expected">""</error>)
|
||||
}
|
||||
when (a) {
|
||||
is String, is Any -> a.<error descr="[UNRESOLVED_REFERENCE] Unresolved reference: compareTo">compareTo</error>("")
|
||||
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
fun foo(u : Unit) : Int = 1
|
||||
|
||||
fun test() : Int {
|
||||
<error descr="[INAPPLICABLE_CANDIDATE] Inapplicable candidate(s): /foo">foo</error>(1)
|
||||
foo(<error descr="[ARGUMENT_TYPE_MISMATCH] Argument type mismatch: actual type is kotlin/Int but kotlin/Unit was expected">1</error>)
|
||||
val a : () -> Unit = {
|
||||
<error descr="[INAPPLICABLE_CANDIDATE] Inapplicable candidate(s): /foo">foo</error>(1)
|
||||
foo(<error descr="[ARGUMENT_TYPE_MISMATCH] Argument type mismatch: actual type is kotlin/Int but kotlin/Unit was expected">1</error>)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
|
||||
+1
-1
@@ -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 = <error descr="[INAPPLICABLE_CANDIDATE] Inapplicable candidate(s): /takeFirst">takeFirst</error>(expr)
|
||||
val c = takeFirst(<error descr="[ARGUMENT_TYPE_MISMATCH] Argument type mismatch: actual type is kotlin/CharSequence but kotlin/text/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)
|
||||
|
||||
Reference in New Issue
Block a user