phase0/02: TypeQuery product policy pack and short primitives - #81
Merged
Conversation
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.
Contributor
|
Tick the box to add this pull request to the merge queue (same as
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stack
Base:
phase0/01-recursive-type→ this PR →phase0/03-object-abiTest plan