Fix for erroneous use of val in basic fors.

This commit is contained in:
Reinier Zwitserloot committed 2015-01-21 01:11:38 +01:00
1 parent cd139f4635
commit d9572c05b1
1 file changed
+3 -1
@@ -128,7 +128,9 @@ public class PatchVal {
if (!isVal(local.type, scope)) return false;
if (new Throwable().getStackTrace()[2].getClassName().contains("ForStatement")) return false;
StackTraceElement[] st = new Throwable().getStackTrace();
if (st.length > 2 && st[2].getClassName().contains("ForStatement")) return false;
if (st.length > 8 && st[8].getClassName().contains("ForStatement")) return false;
Expression init = local.initialization;
if (init == null && Reflection.initCopyField != null) {