/** * Canonical constructor-super analysis — the SINGLE source of truth for the one * question every KERN layer must answer the same way: does a constructor contain * a direct `super(...)` constructor call? * * KERN's constructor semantic (Option C): a derived constructor MAY omit * `super(...)`. When it does, KERN implicitly initializes the base first; when it * writes an explicit `super(...)`, the author owns its placement and the strict * discipline (no double/conditional super, no `this` before super) applies. The * fork between those two modes is decided by exactly this predicate, and it MUST * be decided identically by the semantic validator, the in-process core runtime, * and BOTH codegen targets (TS + Python) — otherwise a program is legal in one * layer and rejected/divergent in another (the precise bug this module exists to * prevent). Previously each layer answered it differently: the validator walked * the IR, while both codegens scanned EMITTED text (`/\bsuper\s*\(/` / * `"super().__init__"`), which false-matched `super(` inside string literals and * comments. One structural predicate, consumed everywhere, removes that drift. * * "Direct" mirrors the validator's long-standing rule precisely: * - a `super(...)` call where the callee is the bare `super` identifier counts; * - `super.method()` (a super MEMBER call) does NOT — it never initializes base; * - a `super(...)` inside a lambda/arrow body does NOT — it never runs at * construction time; * - calls inside `if`/`else` branches DO count (the call is structurally present; * whether it runs on every path is a separate discipline concern). */ import type { IRNode } from './types.js'; /** * Does this constructor contain a direct `super(...)` constructor call anywhere * in its body (including inside `if`/`else` branches, but not inside lambdas or * nested classes)? `true` => explicit-super mode (author owns placement, strict * discipline applies). `false` => implicit-super mode (KERN injects base init). */ export declare function hasDirectSuperCtorCall(ctor: IRNode): boolean;