[FIR] Implement FUNCTION_CALL_EXPECTED
This commit is contained in:
@@ -21,8 +21,8 @@ fun test(l : java.util.List<Int>) {
|
||||
|
||||
val f : java.io.File? = null
|
||||
|
||||
Collections.<!UNRESOLVED_REFERENCE!>emptyList<!>
|
||||
Collections.<!UNRESOLVED_REFERENCE!>emptyList<!><Int>
|
||||
Collections.<!FUNCTION_CALL_EXPECTED!>emptyList<!>
|
||||
Collections.<!FUNCTION_CALL_EXPECTED!>emptyList<!><<!CANNOT_INFER_PARAMETER_TYPE!>Int<!>>
|
||||
Collections.emptyList<Int>()
|
||||
Collections.<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>emptyList<!>()
|
||||
|
||||
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
fun test() = ("").<!UNRESOLVED_REFERENCE!>hashCode<!>::hashCode
|
||||
Vendored
+1
@@ -1 +1,2 @@
|
||||
// FIR_IDENTICAL
|
||||
fun test() = ("").<!FUNCTION_CALL_EXPECTED!>hashCode<!>::hashCode
|
||||
|
||||
@@ -9,8 +9,8 @@ class Foo {
|
||||
}
|
||||
|
||||
fun x(f : Foo) {
|
||||
f.<!UNRESOLVED_REFERENCE!>prop<!>
|
||||
f.<!UNRESOLVED_REFERENCE!>bar<!>
|
||||
f.<!FUNCTION_CALL_EXPECTED!>prop<!>
|
||||
f.<!FUNCTION_CALL_EXPECTED!>bar<!>
|
||||
|
||||
f.<!UNRESOLVED_REFERENCE!>a<!>()
|
||||
<!UNRESOLVED_REFERENCE!>c<!>()
|
||||
|
||||
@@ -7,8 +7,8 @@ import checkSubtype
|
||||
fun main(args : Array<String>) {
|
||||
val x = checkSubtype<Any>(args[0])
|
||||
if(x is java.lang.CharSequence) {
|
||||
if (<!EQUALITY_NOT_APPLICABLE!>"a" == x<!>) x.<!UNRESOLVED_REFERENCE!>length<!> else x.length() // OK
|
||||
if (<!EQUALITY_NOT_APPLICABLE!>"a" == x<!> || <!EQUALITY_NOT_APPLICABLE!>"b" == x<!>) x.<!UNRESOLVED_REFERENCE!>length<!> else x.length() // <– THEN ERROR
|
||||
if (<!EQUALITY_NOT_APPLICABLE!>"a" == x<!> && <!EQUALITY_NOT_APPLICABLE!>"a" == x<!>) x.<!UNRESOLVED_REFERENCE!>length<!> else x.length() // <– ELSE ERROR
|
||||
if (<!EQUALITY_NOT_APPLICABLE!>"a" == x<!>) x.<!FUNCTION_CALL_EXPECTED!>length<!> else x.length() // OK
|
||||
if (<!EQUALITY_NOT_APPLICABLE!>"a" == x<!> || <!EQUALITY_NOT_APPLICABLE!>"b" == x<!>) x.<!FUNCTION_CALL_EXPECTED!>length<!> else x.length() // <– THEN ERROR
|
||||
if (<!EQUALITY_NOT_APPLICABLE!>"a" == x<!> && <!EQUALITY_NOT_APPLICABLE!>"a" == x<!>) x.<!FUNCTION_CALL_EXPECTED!>length<!> else x.length() // <– ELSE ERROR
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
fun import() {
|
||||
<!UNRESOLVED_REFERENCE!>import<!> a<!SYNTAX!>.<!><!UNRESOLVED_REFERENCE!>*<!><!SYNTAX!><!>
|
||||
<!FUNCTION_CALL_EXPECTED!>import<!> <!UNRESOLVED_REFERENCE!>a<!><!SYNTAX!>.<!><!UNRESOLVED_REFERENCE!>*<!><!SYNTAX!><!>
|
||||
}
|
||||
|
||||
fun composite() {
|
||||
@@ -7,9 +7,9 @@ fun composite() {
|
||||
}
|
||||
|
||||
fun html() {
|
||||
<!SYNTAX!><<!><!UNRESOLVED_REFERENCE!>html<!>><!SYNTAX!><<!><!UNRESOLVED_REFERENCE!>/<!><!UNRESOLVED_REFERENCE!>html<!>><!SYNTAX!><!>
|
||||
<!SYNTAX!><<!><!FUNCTION_CALL_EXPECTED!>html<!><!UNRESOLVED_REFERENCE!>><!><!SYNTAX!><<!><!UNRESOLVED_REFERENCE!>/<!><!FUNCTION_CALL_EXPECTED!>html<!>><!SYNTAX!><!>
|
||||
}
|
||||
|
||||
fun html1() {
|
||||
<!SYNTAX!><<!><!UNRESOLVED_REFERENCE!>html<!>><!SYNTAX!><<!><!UNRESOLVED_REFERENCE!>/<!><!UNRESOLVED_REFERENCE!>html<!>><!UNRESOLVED_REFERENCE!>html<!>
|
||||
<!SYNTAX!><<!><!FUNCTION_CALL_EXPECTED!>html<!><!UNRESOLVED_REFERENCE!>><!><!SYNTAX!><<!><!UNRESOLVED_REFERENCE!>/<!><!FUNCTION_CALL_EXPECTED!>html<!>><!ARGUMENT_TYPE_MISMATCH, FUNCTION_CALL_EXPECTED!>html<!>
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// NI_EXPECTED_FILE
|
||||
// See EA-76890 / KT-10843: NPE during analysis
|
||||
fun lambda(x : Int?) = x?.<!UNRESOLVED_REFERENCE!>let<!> l {
|
||||
fun lambda(x : Int?) = x?.<!FUNCTION_CALL_EXPECTED!>let<!> <!UNRESOLVED_REFERENCE!>l<!> {
|
||||
y ->
|
||||
if (y <!UNRESOLVED_REFERENCE!>><!> 0) return@l x
|
||||
y
|
||||
|
||||
Vendored
+1
-1
@@ -58,7 +58,7 @@ fun test(a: A, b: B) {
|
||||
|
||||
b.(foo)()
|
||||
|
||||
(b.<!UNRESOLVED_REFERENCE!>foo<!>)()
|
||||
(<!UNRESOLVED_REFERENCE!>b.<!FUNCTION_CALL_EXPECTED!>foo<!><!>)()
|
||||
|
||||
foo(b)
|
||||
(foo)(b)
|
||||
|
||||
-37
@@ -1,37 +0,0 @@
|
||||
// FILE: KotlinFile.kt
|
||||
fun foo(javaClass: JavaClass) {
|
||||
javaClass.isSomething = !javaClass.isSomething
|
||||
javaClass.isSomething2 = !javaClass.isSomething2
|
||||
|
||||
javaClass.<!UNRESOLVED_REFERENCE!>something<!>
|
||||
javaClass.isSomethingWrong
|
||||
javaClass.<!UNRESOLVED_REFERENCE!>somethingWrong<!>
|
||||
|
||||
javaClass.<!UNRESOLVED_REFERENCE!>issueFlag<!>
|
||||
javaClass.<!UNRESOLVED_REFERENCE!>isSueFlag<!>
|
||||
}
|
||||
|
||||
// FILE: JavaClass.java
|
||||
public class JavaClass {
|
||||
public boolean isSomething() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public void setSomething(boolean value) {
|
||||
}
|
||||
|
||||
public boolean getIsSomething2() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public void setIsSomething2(boolean value) {
|
||||
}
|
||||
|
||||
public int isSomethingWrong() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
public boolean issueFlag() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// FILE: KotlinFile.kt
|
||||
fun foo(javaClass: JavaClass) {
|
||||
javaClass.isSomething = !javaClass.isSomething
|
||||
|
||||
Reference in New Issue
Block a user