https://kotlinlang.org logo
Title
k

Ken

02/03/2022, 7:09 PM
Hi, I'm working on moving the
enclosingElement
field up to
XElement
(https://android-review.googlesource.com/c/platform/frameworks/support/+/1948583). This means that now every element can use this field to access its parent. The field is nullable and will be null for file member containers in Kotlin and top-level class elements in Java (we don't support package or module elements for now). This brings some breaking changes as we unified the naming for some subtypes. For example, fields like
JavacEnumEntry.enumTypeElement
,
JavacMethodParameter.enclosingMethodElement
, and
KspExecutableParameterElement.enclosingMethodElement
are replaced with this
enclosingElement
. We also added a
XElement.closestMemberContainer
with this change to get the closest containing member container. This field is non-nullable and could return itself if
this
is already a member container. Please let me know if you have any concerns.
👍 4
👍🏼 1
e

elihart

03/10/2022, 5:02 AM
thanks for the heads up. sounds like useful changes.