Detect recursive property accessors #KT-17221 Fixed

This commit is contained in:
Dmitry Neverov
2017-05-12 06:02:57 +02:00
committed by Mikhail Glukhikh
parent 20f5023c48
commit 3b4dafe691
12 changed files with 376 additions and 0 deletions
@@ -0,0 +1,23 @@
<html>
<body>
Reports recursive property accessor calls which can end up with StackOverflowError
<p>
For example:
<code><pre>
<b>class</b> A {
<b>var</b> x = 0
<b>get</b>() {
<b>return</b> x //recursive getter call
}
<b>var</b> y = 0
<b>set</b>(value) {
<b>if</b> (value > 0) {
y = value //recursive setter call
}
}
}
</pre></code>
</p>
</body>
</html>