Misc: Do not use resolved call of outer expression if current call expression has no callee

#KT-10105 Fixed
This commit is contained in:
Alexey Sedunov
2015-11-20 16:15:58 +03:00
parent a01a18cb1a
commit b75665a96a
6 changed files with 53 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
== foo ==
fun foo() {
int x = ()()
}
---------------------
L0:
1 <START>
2 mark({ int x = ()() })
magic[UNRESOLVED_CALL](int) -> <v0>
mark(= ())
magic[UNRESOLVED_CALL](= ()) -> <v1>
mark(= ()())
call(= ()(), <ERROR FUNCTION>|<v1>) -> <v2>
magic[VALUE_CONSUMER](= ()()|<v2>) -> <v3>
mark(int x = ()())
call(int x = ()(), <ERROR FUNCTION>|<v0>) -> <v4>
L1:
1 <END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
<SINK> PREV:[<ERROR>, <END>]
=====================
+3
View File
@@ -0,0 +1,3 @@
fun foo() {
int x = ()()
}
+12
View File
@@ -0,0 +1,12 @@
== foo ==
fun foo() {
int x = ()()
}
---------------------
<v3>: * NEW: magic[VALUE_CONSUMER](= ()()|<v2>) -> <v3>
int <v0>: * NEW: magic[UNRESOLVED_CALL](int) -> <v0>
= () <v1>: * NEW: magic[UNRESOLVED_CALL](= ()) -> <v1>
= ()() <v2>: * NEW: call(= ()(), <ERROR FUNCTION>|<v1>) -> <v2>
int x = ()() <v4>: * NEW: call(int x = ()(), <ERROR FUNCTION>|<v0>) -> <v4>
{ int x = ()() } <v4>: * COPY
=====================