CFA: detect captured writes more precisely

So #KT-14381 Fixed
So #KT-13597 Fixed
Also refactors captured writes detection inside DFA
This commit is contained in:
Mikhail Glukhikh
2017-04-27 13:34:24 +03:00
committed by Mikhail Glukhikh
parent 8fa739ed0f
commit 56e633e345
8 changed files with 116 additions and 50 deletions
@@ -0,0 +1,22 @@
class Your {
init {
var y: String? = "xyz"
if (y != null) {
// Bug that should be fixed
// Problem: descriptorToDeclaration cannot get here init block by its descriptor
// See PreliminaryDeclarationVisitor.getVisitorByVariable
<!SMARTCAST_IMPOSSIBLE!>y<!>.hashCode()
}
}
constructor()
}
class Normal {
init {
var y: String? = "xyz"
if (y != null) {
<!DEBUG_INFO_SMARTCAST!>y<!>.hashCode()
}
}
}