irx.analysis.class_lifecycle
irx.analysis.class_lifecycle
Source: packages/irx/src/irx/analysis/class_lifecycle.py
title: Class ownership, constructor binding, and bounded lifecycle validity.Functions
reject_hook_call(analyzer: SemanticAnalyzerCore, node: astx.AST, name: str) -> bool
title: Reject explicit calls to compiler-only lifecycle entry points.
parameters:
analyzer:
type: SemanticAnalyzerCore
node:
type: astx.AST
name:
type: str
returns:
type: boollifecycle_error(analyzer: SemanticAnalyzerCore, node: astx.AST, message: str) -> None
title: Reject an unsupported or unsafe lifecycle operation.
parameters:
analyzer:
type: SemanticAnalyzerCore
node:
type: astx.AST
message:
type: strfield_resource(type_: astx.DataType | None) -> ResourceKind | None
title: Classify supported owned instance storage during analysis.
parameters:
type_:
type: astx.DataType | None
returns:
type: ResourceKind | Noneunsupported_class_field(type_: astx.DataType) -> bool
title: Preserve scalar unions while rejecting unmodeled field resources.
parameters:
type_:
type: astx.DataType
returns:
type: boolcontains_class(type_: astx.DataType | None) -> bool
title: Detect class references hidden in unsupported aggregate types.
parameters:
type_:
type: astx.DataType | None
returns:
type: boolclass_ownership(kind: OwnershipKind, *, symbol: str | None=None, transfer: OwnershipTransferKind=OwnershipTransferKind.NONE, escape: OwnershipEscapeKind=OwnershipEscapeKind.NONE) -> ResourceOwnership
title: Describe one owned reference, not a unique object.
parameters:
kind:
type: OwnershipKind
symbol:
type: str | None
transfer:
type: OwnershipTransferKind
escape:
type: OwnershipEscapeKind
returns:
type: ResourceOwnershipacquire_class(analyzer: SemanticAnalyzerCore, node: astx.AST, value: astx.AST | None, symbol: str | None=None) -> None
title: Resolve an owned reference acquired by a binding, store, or return.
parameters:
analyzer:
type: SemanticAnalyzerCore
node:
type: astx.AST
value:
type: astx.AST | None
symbol:
type: str | Noneclass_local(analyzer: SemanticAnalyzerCore, node: astx.VariableDeclaration | astx.InlineVariableDeclaration, symbol: SemanticSymbol) -> None
title: Resolve a class reference owner without changing alias semantics.
parameters:
analyzer:
type: SemanticAnalyzerCore
node:
type: astx.VariableDeclaration | astx.InlineVariableDeclaration
symbol:
type: SemanticSymbollifecycle_plan(class_: SemanticClass, initialization: SemanticClassInitialization) -> SemanticClassInitialization
title: Resolve base-first phases from canonical field storage order.
parameters:
class_:
type: SemanticClass
initialization:
type: SemanticClassInitialization
returns:
type: SemanticClassInitializationconstructor_arguments(analyzer: SemanticAnalyzerCore, node: astx.ClassConstruct | astx.FunctionCall | astx.MethodCall, class_: SemanticClass) -> tuple[tuple[astx.DataType, ...], tuple[int, ...], tuple[astx.DataType, ...]]
title: Bind constructor names while preserving supplied evaluation order.
parameters:
analyzer:
type: SemanticAnalyzerCore
node:
type: astx.ClassConstruct | astx.FunctionCall | astx.MethodCall
class_:
type: SemanticClass
returns:
type: >-
tuple[tuple[astx.DataType, Ellipsis], tuple[int, Ellipsis],
tuple[astx.DataType, Ellipsis]]lifecycle_children(node: astx.AST) -> Iterator[astx.AST]
title: Traverse source children without semantic/parent backreferences.
parameters:
node:
type: astx.AST
returns:
type: Iterator[astx.AST]validate_hook(analyzer: SemanticAnalyzerCore, declaration: astx.FunctionDef) -> None
title: Forbid resurrection, receiver escape, and unsafe hook declarations.
parameters:
analyzer:
type: SemanticAnalyzerCore
declaration:
type: astx.FunctionDefvalidate_class_graph(analyzer: SemanticAnalyzerCore) -> None
title: Reject strong ownership cycles including assignable subtypes.
parameters:
analyzer:
type: SemanticAnalyzerCoreresolve_store(analyzer: SemanticAnalyzerCore, node: astx.BinaryOp, symbol: SemanticSymbol) -> bool
title: Resolve managed storage before ordinary assignment validation.
parameters:
analyzer:
type: SemanticAnalyzerCore
node:
type: astx.BinaryOp
symbol:
type: SemanticSymbol
returns:
type: boolvalidate_file_fields(analyzer: SemanticAnalyzerCore, class_: SemanticClass) -> None
title: Prove exactly-once initialization of native file fields.
parameters:
analyzer:
type: SemanticAnalyzerCore
class_:
type: SemanticClassClasses
ClassHookSpec
title: One language-defined class protocol, not a private method.
attributes:
name:
type: str
accepts_parameters:
type: bool
is_lifecycle:
type: bool