Use direct field access to trivial class properties

#KT-3845 Fixed
This commit is contained in:
Alexander Udalov
2014-07-16 20:51:40 +04:00
parent 1555a3756c
commit 4bdf7e3426
4 changed files with 48 additions and 2 deletions
@@ -273,7 +273,7 @@ public class JvmCodegenUtil {
if (accessor == null) return true;
// If the accessor is non-default (i.e. it has some code) we should call that accessor and not use direct access
if (!accessor.isDefault()) return false;
if (accessor.hasBody()) return false;
// If the accessor is private or final, it can't be overridden in the subclass and thus we can use direct access
return property.getVisibility() == Visibilities.PRIVATE || accessor.getModality() == FINAL;