Use of uninitialized variables in lambdas / object literals / local functions is forbidden now #KT-4475 Fixed

Local declarations CFA: variable initialization information before them is now taken into account
This commit is contained in:
Mikhail Glukhikh
2015-11-11 13:05:40 +03:00
parent 89791dc85c
commit fe13f39de9
26 changed files with 245 additions and 105 deletions
@@ -43,15 +43,15 @@ fun foo() {
}
---------------------
L3:
3 <START> INIT: in: {} out: {}
3 <START> INIT: in: {bar=D} out: {bar=D}
4 mark({ val a = 2 })
v(val a = 2) INIT: in: {} out: {a=D}
r(2) -> <v0> INIT: in: {a=D} out: {a=D}
w(a|<v0>) INIT: in: {a=D} out: {a=ID}
v(val a = 2) INIT: in: {bar=D} out: {a=D, bar=D}
r(2) -> <v0> INIT: in: {a=D, bar=D} out: {a=D, bar=D}
w(a|<v0>) INIT: in: {a=D, bar=D} out: {a=ID, bar=D}
L4:
3 <END> INIT: in: {} out: {}
3 <END> INIT: in: {bar=D} out: {bar=D}
error:
<ERROR>
<ERROR> INIT: in: {} out: {}
sink:
<SINK> USE: in: {} out: {}
<SINK> INIT: in: {bar=D} out: {bar=D} USE: in: {} out: {}
=====================