fix(lidl): exclude LogosModuleContext hooks from header-derived contracts

--header-to-lidl parses an impl class's public methods. An impl commonly
overrides onContextReady() (and could redeclare a context accessor) in its
own public section, so the derived LIDL would include onContextReady /
modules / modulePath / instanceId / instancePersistencePath. Those are
framework plumbing, not API methods — and feeding them to the cdylib
backend breaks cdylib-eligibility (e.g. the inherited accessors' Qt-free
return-type check), which is exactly what header-first universal modules
now hit. Skip the reserved LogosModuleContext names in the parser so both
the Qt --from-header path and the cdylib --header-to-lidl path emit clean,
API-only contracts.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Dario Gabriel Lipicar
2026-06-13 18:11:27 -03:00
co-authored by Claude Opus 4.8
parent f66b38b733
commit 0d3fa58b7e
@@ -445,8 +445,22 @@ ImplParseResult parseImplHeader(const QString& headerPath,
QString decl = line.left(line.size() - 1).trimmed();
MethodDecl md;
if (parseMethodLine(decl, md)) {
md.description = joinDocLines(pendingDoc);
result.module.methods.append(md);
// LogosModuleContext lifecycle hooks / context accessors are
// framework plumbing, not part of the module's API contract.
// An impl commonly overrides `onContextReady()` (and could
// re-declare an accessor) in its own public section, so the
// header parser would otherwise emit them into the derived
// LIDL — breaking cdylib eligibility (e.g. the inherited
// accessors' Qt-free-subset check) and exposing non-API
// methods. Skip the reserved names regardless of access.
static const QSet<QString> reserved = {
"onContextReady", "modules", "modulePath",
"instanceId", "instancePersistencePath"
};
if (!reserved.contains(md.name)) {
md.description = joinDocLines(pendingDoc);
result.module.methods.append(md);
}
}
}
pendingDoc.clear();