Class OwnProperty
java.lang.Object
org.ek9lang.compiler.support.OwnProperty
THE "is this a property of the object whose code is running?" - use it, never re-derive it. Two halves, and a
check that cares about the OBJECT (not just the declaration) needs both:
isPropertyOf(ISymbol, IAggregateSymbol)- SYMBOL identity againstaggregate.getProperties(): one of this type's OWN declared properties. Never a super's, never a same-named property of another type, and never a capture: a dynamic function's or class's captures are property FIELDS (CaptureScope.definemarks them so) but they live in its capture scope, not ingetProperties().accessedDirectly(EK9Parser.ObjectAccessExpressionContext, Predicate)- the PARSE formthis.prop(oralias.propwhen the caller's receiver test accepts the start): one step from the receiver, never through a further property or a call, which reach another object.
Identity alone cannot tell this.conn from other.conn (same symbol, another object); the form alone
cannot tell a property from a capture. Shared by E08250 (a constructor storing 'this' into its own property is not an
escape) and E08251 (a write to a field of the enclosing aggregate is shared state). It also served the
close statement's ownership checks until that statement was removed (2026-10-06, D4); its
namedOnThis went with it. Extracted 2026-10-05 from two private copies
(SharedStateMutationOutsideLockOrError.isFieldOf, ConstructorThisEscapeOrError.isOwnProperty).
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Predicate<EK9Parser.ObjectAccessStartContext> The receiver test foraccessedDirectly(EK9Parser.ObjectAccessExpressionContext, Predicate)when onlythisitself will do. -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanaccessedDirectly(EK9Parser.ObjectAccessExpressionContext objectAccessExpression, Predicate<EK9Parser.ObjectAccessStartContext> receiverTest) True when the object access is a single property step (start.prop, no further access, no call) from a start the receiver test accepts -THIS_RECEIVERforthis.proponly.static booleanisPropertyOf(ISymbol candidate, IAggregateSymbol aggregate) True whencandidateis one ofaggregate's own declared properties - by identity, never by name.
-
Field Details
-
THIS_RECEIVER
The receiver test foraccessedDirectly(EK9Parser.ObjectAccessExpressionContext, Predicate)when onlythisitself will do.
-
-
Method Details
-
isPropertyOf
True whencandidateis one ofaggregate's own declared properties - by identity, never by name. -
accessedDirectly
public static boolean accessedDirectly(EK9Parser.ObjectAccessExpressionContext objectAccessExpression, Predicate<EK9Parser.ObjectAccessStartContext> receiverTest) True when the object access is a single property step (start.prop, no further access, no call) from a start the receiver test accepts -THIS_RECEIVERforthis.proponly.
-