fix(typia): validate intersected object unions#1909
Conversation
|
Research Review Round 1 produced surviving proposals. Applied follow-up commit b805844 to split native-name metadata tests, add direct UnionPredicator coverage for shared native fields, harden the transform runtime fixture/import guards, and expand the valid/invalid intersection matrix. Local Go validation has been rerun after the follow-up. |
|
Research Review Round 2 produced surviving proposals. Applied follow-up commit 19e4042 to mirror reserved-word handling in the shared transform runtime stub and remove #1590 from .wiki before final issue closure. Local validation was rerun after the follow-up: pnpm format, focused transform/metadata/UnionPredicator tests, pnpm test:go, diff checks, and .wiki no-match search. |
|
Research Review Round 3 produced one surviving proposal. Applied follow-up commit 588e02f to rename the shared transform helper file to *_test.go so it is listed under TestGoFiles, not production GoFiles. Verified with go list, focused transform tests, UnionPredicator test, pnpm run format:go, pnpm test:go, diff checks, and .wiki no-match search. |
|
Research Review Round 4 follow-up applied in
Local validation already passed before the push: |
|
Research Review Round 5 follow-up applied in
Focused validation after the patch passed: |
|
Research Review Round 6 follow-up applied in
Focused validation passed after the patch: |
|
Round 7 follow-up pushed in 9a15ad5. I kept the transform runtime Date regression focused on rejection across is/validate/assert/direct validate, moved template-only negative coverage into the template containment test, added direct Neighbor=true discriminator coverage, added non-identical template overlap coverage, and fixed tuple element containment with tuple/map regression tests. Focused Go validations and pnpm format passed locally. |
|
Round 8 follow-up pushed in 5e86978. I fixed nested collection coverage by removing the top-level-only array/tuple coverage gap with a visited-pair guard, added nested array/tuple regression tests, widened the transform test comment to match its runtime guard scope, and shared the runtime atomic-like native decision between metadata containment and Check_native while explicitly keeping BigInt out of that runtime-wrapper set. Validation passed locally: pnpm format, focused metadata/helper/transform Go tests, and pnpm test:go. |
|
RRR 9 follow-up pushed as Applied validated findings:
Local validation after the push:
Next gate: RRR 10 on |
|
RRR 10 follow-up pushed as Applied validated findings:
Rejected finding:
Local validation after the push:
Next gate: RRR 11 on |
|
RRR 11 follow-up pushed as Applied validated findings:
Rejected finding:
Local validation after the push:
Next gate: RRR 12 on |
|
RRR 12 follow-up pushed as Applied validated findings:
Local validation after the push:
Next gate: RRR 13 on |
Intent
Fix #1590 by making the native transform validate intersected object unions without selecting an overlapping branch from one side of the intersection as if it proved the other side.
Changes
Neighborflag.BigIntexplicitly excluded from that runtime-wrapper set.Party & PartyRoleInfocase acrossis,validate,assert, and directtypia.validatepaths.typiato13.0.0-dev.20260605.11because this PR changes native source shipped in the npm package.Validation
pnpm formatgit diff --checkgo test ./metadata/schema -run 'TestMetadataSchema(CoversNestedCollectionEntries|CoversTupleEntries|CoversMapEntries|CoversAtomicLikeNatives|IntersectsAtomicLikeNatives)$' -count=1 -vfrompackages/typia/testgo test ./metadata/schema -run 'TestMetadataSchema(CoversTupleEntries|Covers|Intersects)' -count=1 -vfrompackages/typia/testgo test ./helpers/predicator -run 'TestAtomicPredicator(RejectsNativeOverlaps|RecognizesPrimitiveNativeNames)$' -count=1 -vfrompackages/typia/testgo test ./core/programmers/internal ./core/programmers/json ./core/programmers/iterate -count=1frompackages/typia/nativego test ./core/schemas/metadata ./core/programmers/iterate -count=1frompackages/typia/nativego test ./core/programmers/helpers -run 'TestUnionPredicator(SkipsAtomicLikeNativeFields|ChecksNeighborFlag|SkipsSharedTemplateFields)$' -count=1 -vfrompackages/typia/nativego test ./core/programmers/helpers -run 'TestUnionPredicator(SkipsSharedObjectFields|SkipsSharedNativeNames|SkipsCollectionBucketFields|ChecksNeighborFlag)$' -count=1 -vfrompackages/typia/nativego test ./cmd/ttsc-typia -run TestIntersectionUnionValidationTransform -count=1 -vfrompackages/typia/nativepnpm test:goLocal Limitations
pnpm testis blocked on Node v22.15.0 before this PR's tests run because localttscresolvestypia/lib/transformtopackages/typia/src/transform.ts, which this Node version cannot require directly. GitHub CI uses Node 24.x.go test -tags typia_native_internal ./...frompackages/typia/testis still blocked by existing package-layout/internal-import constraints outside this PR.Remaining Gates
27cb467cf.Fixes #1590.