You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Emit unknown for return types tywrap can't resolve, instead of a bare, undeclared TypeScript name. Breaking change — there will be more unknown in generated output, and --fail-on-warn builds may newly fail, which is the intent.
Today a return type whose class isn't in the analyzed module is emitted as a bare leaf name (for example Module) that nothing declares. That should be unknown, with a build-time note.
What changes
tywrap_ir/tywrap_ir/ir.py — keep the full dotted path (or an explicit out-of-module marker) instead of reducing <class 'mod.Name'> to Name, and record a warning when a return resolves out-of-module or unannotated. This changes the IR schema; the version bump lands in PR9: [breaking] pinned IR contract artifact + TS/Python IR-version check #269.
src/core/mapper.ts — carry the module through so the generator can tell in-module from out-of-module. This PR owns the degrade-to-unknown rule.
src/core/generator.ts — emit a type name only when it's locally declared or backed by a codec; otherwise emit unknown and call a degrade hook. Base the "keep typed" set on the types that actually round-trip through a codec — verify against the codec set (for example, numpy arrays go through the marker path, not the preset table).
src/tywrap.ts — wire the degrade hook into the existing unknown-type reporting so --fail-on-warn covers the generated-types path.
Done when
A third-party return emits unknown, codec-backed types keep their mapped type, and degrades show up in the generation report.
Emit
unknownfor return types tywrap can't resolve, instead of a bare, undeclared TypeScript name. Breaking change — there will be moreunknownin generated output, and--fail-on-warnbuilds may newly fail, which is the intent.Today a return type whose class isn't in the analyzed module is emitted as a bare leaf name (for example
Module) that nothing declares. That should beunknown, with a build-time note.What changes
tywrap_ir/tywrap_ir/ir.py— keep the full dotted path (or an explicit out-of-module marker) instead of reducing<class 'mod.Name'>toName, and record a warning when a return resolves out-of-module or unannotated. This changes the IR schema; the version bump lands in PR9: [breaking] pinned IR contract artifact + TS/Python IR-version check #269.src/core/mapper.ts— carry the module through so the generator can tell in-module from out-of-module. This PR owns the degrade-to-unknownrule.src/core/generator.ts— emit a type name only when it's locally declared or backed by a codec; otherwise emitunknownand call a degrade hook. Base the "keep typed" set on the types that actually round-trip through a codec — verify against the codec set (for example, numpy arrays go through the marker path, not the preset table).src/tywrap.ts— wire the degrade hook into the existing unknown-type reporting so--fail-on-warncovers the generated-types path.Done when
A third-party return emits
unknown, codec-backed types keep their mapped type, and degrades show up in the generation report.Depends on: #266.