cl: conf.LoadLibcPubFile; ctx.ignoreType ignore if not exists; cl initClassTypeEx, loadClassMember, compileVar: accept unsupported type; cl loadLinkageSpec; vtableName: _xgo_vtable_XXX => X_vtable_XXX; ...; tool: cfg.GroupSubdir - #887
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #887 +/- ##
==========================================
- Coverage 88.44% 87.60% -0.85%
==========================================
Files 22 22
Lines 1896 1944 +48
==========================================
+ Hits 1677 1703 +26
- Misses 219 241 +22
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Review summary
This PR adds a LoadLibcPubFile option so the libc package can be imported via importPkg (loading its pub file and registering its type names into ctx.types) instead of a plain pkg.Import. It also makes importPkg return *types.Package, adds the ignoreType helper, and makes enum loading fail loudly on an ignored underlying type. The change builds and go vet ./cl/ passes cleanly.
The design is sound. A few points below are worth a look — the main one is a latent-fragility nit around the two-branch libc import, plus an intent check on the new enum panic.
Note (not inline, pre-existing): with LoadLibcPubFile=true the libc pub file is now loaded at NewPackage init, so importPkg/loadPubFile parse failures (malformed line, unsupported f/v entry, missing pub-file lookup) surface as panic/log.Panicln during init rather than degrading to the plain pkg.Import path. These panics are pre-existing in importPkg/loadPubFile and not introduced by this diff; the libc pub file is a trusted first-party artifact, so risk is low. Flagging only because this path is newly exercised at init.
…ype; cl loadLinkageSpec
…tx.unsafePointer; tool goFileOf: add prefix z if fname starts with _
cl newTypeParams: fix empty param name; check unsupported features; ctx.unsafePointer; tool goFileOf: add prefix z if fname starts with _