Skip to content

phase0/02: TypeQuery product policy pack and short primitives - #81

Merged
rieske merged 7 commits into
masterfrom
phase0/02-type-policy
Jul 27, 2026
Merged

phase0/02: TypeQuery product policy pack and short primitives#81
rieske merged 7 commits into
masterfrom
phase0/02-type-policy

Conversation

@rieske

@rieske rieske commented Jul 27, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add TypeQuery product policy pack and short primitive helpers.
  • Review fixes: array base index stride uses element size; Round-2/3 residuals.

Stack

Base: phase0/01-recursive-type → this PR → phase0/03-object-abi

Test plan

  • TypeQuery unit tests pass
  • No regressions vs phase0/01 tip

rieske added 6 commits July 27, 2026 17:17
Introduce productAssignFrom as the named assign policy (productCanAssignFrom
aliases it), plus productValueCompatible / productArithmeticCompatible and
usual-arithmetic helpers for later SA/codegen use. Add short primitives and
pointer-to-array subscript stride in arraySubscriptInfo.

Keep master-pinned assign rejections (function designators, arrays, incomplete
dest). Unit tests cover the new policy surface; full suite green.
- Document productAssignFrom as its own gate (not valueCompatible+).
- Shared recordsCompatible / isNullConstantCandidate helpers.
- productArithmeticCompatible collapses to isArithmeticType.
- Unified objectStrideBytes for subscript strides.
- isIncompleteMemberOrElementType includes incomplete records.
- Use isIntegral for null-constant pointer assign.
- Unit tests for union product assign and arithmetic scalar-only.
objectStrideBytes(baseType) for T[N] returned sizeof(T[N]), so a[i] stepped
by the whole array. Use objectStrideBytes(elementType) for array bases.
- Implement array element stride via shared objectStrideBytes.
- Prefer isIncompleteRecord in productAssignFrom.
- Pin array-base and dual-type elementStride in unit tests.
- Drop no-op productCanAssignFrom alias identity test.
- objectStrideBytes returns raw getSize (0 for empty complete records).
- Pin isUnsignedSide/valueIsSigned dual for pointers, UAR unsigned win,
  and integerPromote for unsigned short.
- ArraySubscriptInfo::valid() tracks base kind (ok), not stride > 0, so
  empty complete record elements remain valid with stride 0.
- isIncompleteMemberOrElementType aliases isIncompleteObjectType.
- objectStrideBytes comment matches empty-record size-0 policy.
- Unit pins for empty-element subscript and shared incomplete predicates.
@mergify

mergify Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@coveralls

coveralls commented Jul 27, 2026

Copy link
Copy Markdown

Coverage Status

coverage: 92.878% (+0.3%) from 92.585% — phase0/02-type-policy into master

Base automatically changed from phase0/01-recursive-type to master July 27, 2026 15:47
@rieske
rieske merged commit 699f197 into master Jul 27, 2026
3 checks passed
@rieske
rieske deleted the phase0/02-type-policy branch July 27, 2026 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants