FIR: report errors on FirResolvedTypeRef with ConeClassErrorType
Not sure what the difference from FirErrorTypeRef is.
This commit is contained in:
@@ -13,7 +13,7 @@ fun text() {
|
||||
<!INAPPLICABLE_CANDIDATE!>bar2<!> {}
|
||||
bar2 {1}
|
||||
bar2 {<!UNRESOLVED_REFERENCE!>it<!>}
|
||||
bar2 {it -> <!ARGUMENT_TYPE_MISMATCH!>it<!>}
|
||||
bar2 {<!CANNOT_INFER_PARAMETER_TYPE!>it<!> -> <!ARGUMENT_TYPE_MISMATCH!>it<!>}
|
||||
}
|
||||
|
||||
fun bar(f : (Int, Int) -> Int) {}
|
||||
|
||||
@@ -18,7 +18,7 @@ class MyColor(val x: <!UNRESOLVED_REFERENCE!>Color.RED<!>, y: <!UNRESOLVED_REFER
|
||||
class Local : <!UNRESOLVED_REFERENCE!>Color.RED<!>
|
||||
fun local(arg: <!UNRESOLVED_REFERENCE!>Color.RED<!>): <!UNRESOLVED_REFERENCE!>Color.RED<!> = arg
|
||||
val temp: <!UNRESOLVED_REFERENCE!>Color.RED<!> = Color.RED
|
||||
temp as? <!UNRESOLVED_REFERENCE!>Color.RED<!>
|
||||
temp as? <!UNRESOLVED_REFERENCE, UNRESOLVED_REFERENCE!>Color.RED<!>
|
||||
if (temp is <!UNRESOLVED_REFERENCE!>Color.RED<!>) {
|
||||
return temp as <!UNRESOLVED_REFERENCE!>Color.RED<!>
|
||||
}
|
||||
|
||||
@@ -40,8 +40,8 @@ fun main(args : Array<String>) {
|
||||
foo2()({})
|
||||
foo2()<!TOO_MANY_ARGUMENTS!>{}<!>
|
||||
(foo2()){}
|
||||
<!INAPPLICABLE_CANDIDATE!>(foo2())<!>{x -> }
|
||||
<!INAPPLICABLE_CANDIDATE!>foo2()<!>({x -> })
|
||||
<!INAPPLICABLE_CANDIDATE!>(foo2())<!>{<!CANNOT_INFER_PARAMETER_TYPE!>x<!> -> }
|
||||
<!INAPPLICABLE_CANDIDATE!>foo2()<!>({<!CANNOT_INFER_PARAMETER_TYPE!>x<!> -> })
|
||||
|
||||
val a = fooT1(1)()
|
||||
checkSubtype<Int>(a)
|
||||
|
||||
+3
-3
@@ -12,8 +12,8 @@ fun fun_with_where() = fun <!TYPE_PARAMETERS_NOT_ALLOWED!><T><!> <!UNRESOLVED_RE
|
||||
|
||||
fun outer() {
|
||||
devNull(fun <!TYPE_PARAMETERS_NOT_ALLOWED!><T><!>() {})
|
||||
devNull(fun <!TYPE_PARAMETERS_NOT_ALLOWED!><T><!> T.() {})
|
||||
devNull(fun <!TYPE_PARAMETERS_NOT_ALLOWED!><T><!> (): T = null!!)
|
||||
devNull(fun <!TYPE_PARAMETERS_NOT_ALLOWED!><T><!> (t: T) {})
|
||||
devNull(fun <!TYPE_PARAMETERS_NOT_ALLOWED!><T><!> <!UNRESOLVED_REFERENCE!>T<!>.() {})
|
||||
devNull(fun <!TYPE_PARAMETERS_NOT_ALLOWED!><T><!> (): <!UNRESOLVED_REFERENCE, UNRESOLVED_REFERENCE!>T<!> = null!!)
|
||||
devNull(fun <!TYPE_PARAMETERS_NOT_ALLOWED!><T><!> (t: <!UNRESOLVED_REFERENCE!>T<!>) {})
|
||||
devNull(fun <!TYPE_PARAMETERS_NOT_ALLOWED!><T><!> () where T:A {})
|
||||
}
|
||||
|
||||
Vendored
+2
-2
@@ -13,7 +13,7 @@ fun test1() {
|
||||
s: String-> <!ARGUMENT_TYPE_MISMATCH!>""<!>
|
||||
}
|
||||
foo0 {
|
||||
x, y -> <!ARGUMENT_TYPE_MISMATCH!>""<!>
|
||||
<!CANNOT_INFER_PARAMETER_TYPE!>x<!>, <!CANNOT_INFER_PARAMETER_TYPE!>y<!> -> <!ARGUMENT_TYPE_MISMATCH!>""<!>
|
||||
}
|
||||
|
||||
foo1 {
|
||||
@@ -23,7 +23,7 @@ fun test1() {
|
||||
s: String -> <!ARGUMENT_TYPE_MISMATCH!>""<!>
|
||||
}
|
||||
foo1 {
|
||||
x, y -> <!ARGUMENT_TYPE_MISMATCH!>""<!>
|
||||
x, <!CANNOT_INFER_PARAMETER_TYPE!>y<!> -> <!ARGUMENT_TYPE_MISMATCH!>""<!>
|
||||
}
|
||||
foo1 {
|
||||
-> 42
|
||||
|
||||
Vendored
+1
-1
@@ -151,7 +151,7 @@ fun main() {
|
||||
select(id(fun String.(x: String) {}), id(fun(x: String, y: String) { }), { x -> <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>this<!> })
|
||||
select(id(fun String.(x: String) {}), id(fun(x: String, y: String) { }), { x: String, y: String -> x })
|
||||
// Convert to extension lambda is impossible because the lambda parameter types aren't specified explicitly
|
||||
select(id(fun String.(x: String) {}), id(fun(x: String, y: String) { }), { x, y -> x })
|
||||
select(id(fun String.(x: String) {}), id(fun(x: String, y: String) { }), { x, <!CANNOT_INFER_PARAMETER_TYPE!>y<!> -> x })
|
||||
select(id(id(fun(x: String, y: String) { }), <!TOO_MANY_ARGUMENTS!>fun String.(x: String) {}<!>), { x, y -> x })
|
||||
val x26: Int.(String) -> Int = fun (x: String) = 10 // it must be error, see KT-38439
|
||||
// Receiver must be specified in anonymous function declaration
|
||||
|
||||
+3
-3
@@ -8,9 +8,9 @@ fun main() {
|
||||
val x3: () -> String = if (true) {{ -> "this" }} else {{ -> "this" }}
|
||||
val x4: String.() -> String = if (true) {{ str: String -> "this" }} else {{ str: String -> "this" }}
|
||||
val x41: String.(String) -> String = if (true) {{ str: String, str2: String -> "this" }} else {{ str: String, str2: String -> "this" }}
|
||||
val x42: String.(String) -> String = if (true) {{ str, str2 -> "this" }} else {{ str, str2 -> "this" }}
|
||||
val x5: String.() -> String = if (true) {{ str -> "this" }} else {{ str -> "this" }}
|
||||
val x6: String.() -> String = if (true) {{ str -> "this" }} else {{ "this" }}
|
||||
val x42: String.(String) -> String = if (true) {{ str, <!CANNOT_INFER_PARAMETER_TYPE!>str2<!> -> "this" }} else {{ str, <!CANNOT_INFER_PARAMETER_TYPE!>str2<!> -> "this" }}
|
||||
val x5: String.() -> String = if (true) {{ <!CANNOT_INFER_PARAMETER_TYPE!>str<!> -> "this" }} else {{ <!CANNOT_INFER_PARAMETER_TYPE!>str<!> -> "this" }}
|
||||
val x6: String.() -> String = if (true) {{ <!CANNOT_INFER_PARAMETER_TYPE!>str<!> -> "this" }} else {{ "this" }}
|
||||
val x7: String.() -> String = select({ -> this }, { -> this })
|
||||
val x8: String.() -> String = select({ this }, { this })
|
||||
}
|
||||
|
||||
+1
-1
@@ -13,5 +13,5 @@ fun test1() {
|
||||
fun bar(f: (<!UNRESOLVED_REFERENCE!>A<!>)->Unit) {}
|
||||
|
||||
fun test2() {
|
||||
bar { a -> } // here we don't have 'cannot infer parameter type' error
|
||||
bar { <!UNRESOLVED_REFERENCE!>a<!> -> } // here we don't have 'cannot infer parameter type' error
|
||||
}
|
||||
|
||||
@@ -5,13 +5,13 @@ val funLit = lambda@ fun String.() {
|
||||
}
|
||||
|
||||
fun test() {
|
||||
val funLit = lambda@ fun String.(): String {
|
||||
val funLit = lambda@ fun String.(): <!UNRESOLVED_LABEL!>String<!> {
|
||||
return <!UNRESOLVED_LABEL!>this@lambda<!>
|
||||
}
|
||||
}
|
||||
|
||||
fun lambda() {
|
||||
val funLit = lambda@ fun String.(): String {
|
||||
val funLit = lambda@ fun String.(): <!UNRESOLVED_LABEL!>String<!> {
|
||||
return <!UNRESOLVED_LABEL!>this@lambda<!>
|
||||
}
|
||||
}
|
||||
@@ -46,9 +46,9 @@ fun test1() { // to extension lambda 0
|
||||
|
||||
val w11 = W1 { i: Int -> <!ARGUMENT_TYPE_MISMATCH!>i<!> } // oi- ni-
|
||||
val i11: E0 = id { i: Int -> i } // o1+ ni+
|
||||
val w12 = W1 { i -> <!ARGUMENT_TYPE_MISMATCH!>i<!> } // oi- ni-
|
||||
val i12: E0 = id { i -> i } // oi- ni-
|
||||
val j12 = id<E0> { i -> i } // oi- ni-
|
||||
val w12 = W1 { <!CANNOT_INFER_PARAMETER_TYPE!>i<!> -> <!ARGUMENT_TYPE_MISMATCH!>i<!> } // oi- ni-
|
||||
val i12: E0 = id { <!CANNOT_INFER_PARAMETER_TYPE!>i<!> -> i } // oi- ni-
|
||||
val j12 = id<E0> { <!CANNOT_INFER_PARAMETER_TYPE!>i<!> -> i } // oi- ni-
|
||||
|
||||
// yet unsupported cases - considering lambdas as extension ones unconditionally
|
||||
// val w13 = W1 { it } // this or it: oi- ni-
|
||||
@@ -83,8 +83,8 @@ fun test2() { // to extension lambda 1
|
||||
val i27: E1 = <!INITIALIZER_TYPE_MISMATCH!>when (e) { E.VALUE -> { s: String -> <!NO_THIS!>this<!> + s.length } }<!> // oi+ ni+
|
||||
val i27a: E1 = <!INITIALIZER_TYPE_MISMATCH!>when (e) { E.VALUE -> { s -> <!NO_THIS!>this<!> + s.<!UNRESOLVED_REFERENCE!>length<!> } }<!> // oi+ ni+
|
||||
|
||||
val w28 = W2 { i: Int, s -> <!ARGUMENT_TYPE_MISMATCH!>i <!OVERLOAD_RESOLUTION_AMBIGUITY!>+<!> s.<!UNRESOLVED_REFERENCE!>length<!><!> } // oi- ni-
|
||||
val i28: E1 = id { i: Int, s -> i <!OVERLOAD_RESOLUTION_AMBIGUITY!>+<!> s.<!UNRESOLVED_REFERENCE!>length<!> } // oi- ni-
|
||||
val w28 = W2 { i: Int, <!CANNOT_INFER_PARAMETER_TYPE!>s<!> -> <!ARGUMENT_TYPE_MISMATCH!>i <!OVERLOAD_RESOLUTION_AMBIGUITY!>+<!> s.<!UNRESOLVED_REFERENCE!>length<!><!> } // oi- ni-
|
||||
val i28: E1 = id { i: Int, <!CANNOT_INFER_PARAMETER_TYPE!>s<!> -> i <!OVERLOAD_RESOLUTION_AMBIGUITY!>+<!> s.<!UNRESOLVED_REFERENCE!>length<!> } // oi- ni-
|
||||
val w29 = W2 { i: Int, s: String -> <!ARGUMENT_TYPE_MISMATCH!>i + s.length<!> } // oi- ni-
|
||||
val i29: E1 = id { i: Int, s: String -> i + s.length } // oi+ ni+
|
||||
|
||||
|
||||
+3
-3
@@ -22,7 +22,7 @@ class TestSuperForBase : B() {
|
||||
override fun foo() {
|
||||
super<Base>.foo()
|
||||
super<B>.foo()
|
||||
super<MyBase>.<!UNRESOLVED_REFERENCE!>foo<!>()
|
||||
super<<!UNRESOLVED_REFERENCE, UNRESOLVED_REFERENCE!>MyBase<!>>.<!UNRESOLVED_REFERENCE!>foo<!>()
|
||||
<!NOT_A_SUPERTYPE!>super<U><!>.foo()
|
||||
}
|
||||
}
|
||||
@@ -34,8 +34,8 @@ class TestSuperForGenericBase<T> : GB<T>() {
|
||||
override fun foo() {
|
||||
super<GenericBase>.foo()
|
||||
super<GB>.foo()
|
||||
super<MyBase>.<!UNRESOLVED_REFERENCE!>foo<!>()
|
||||
super<MyBaseInt>.<!UNRESOLVED_REFERENCE!>foo<!>() // Type arguments don't matter here
|
||||
super<<!UNRESOLVED_REFERENCE, UNRESOLVED_REFERENCE!>MyBase<!>>.<!UNRESOLVED_REFERENCE!>foo<!>()
|
||||
super<<!UNRESOLVED_REFERENCE, UNRESOLVED_REFERENCE!>MyBaseInt<!>>.<!UNRESOLVED_REFERENCE!>foo<!>() // Type arguments don't matter here
|
||||
<!NOT_A_SUPERTYPE!>super<U><!>.foo()
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -30,7 +30,7 @@ val test3: (String) -> Boolean =
|
||||
|
||||
val test4: (String) -> Boolean =
|
||||
when {
|
||||
true -> { s1, s2 -> true }
|
||||
true -> { s1, <!CANNOT_INFER_PARAMETER_TYPE!>s2<!> -> true }
|
||||
else -> null!!
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user