Skip to content

Fix const-tuple printer misclassifying numeric field ids as object types#275

Merged
ASDAlexander77 merged 2 commits into
mainfrom
fix/const-tuple-print-numeric-field-id
Jul 21, 2026
Merged

Fix const-tuple printer misclassifying numeric field ids as object types#275
ASDAlexander77 merged 2 commits into
mainfrom
fix/const-tuple-print-numeric-field-id

Conversation

@ASDAlexander77

Copy link
Copy Markdown
Owner

Summary

  • isObjectShapedTuple only checked field.id for non-null, so an all-numeric-id ConstTupleType (array-mode literal-type tuples like [1, 2, 3], which use an IntegerAttr id to record position) was misprinted as an object type ({0: 1, 1: 2}) instead of a tuple ([1, 2, 3]). Restricted the check to name-like ids (StringAttr/FlatSymbolRefAttr).
  • Added docs/tuple-object-shape-ambiguity-design.md, documenting a deeper, still-open ambiguity found while investigating this: named-element tuples and object/type-literal fields both produce all-StringAttr ids, so the printer cannot always tell them apart from field-id kind alone. Proposed for later review, not implemented.
  • Unrelated tag-script version bump (v79→v80) included from local working tree.

Test plan

  • Existing suite (no behavior change expected for named-field/object printing; only affects numeric-id const tuples)

@ASDAlexander77
ASDAlexander77 merged commit 2e3fbad into main Jul 21, 2026
2 checks passed
@ASDAlexander77
ASDAlexander77 deleted the fix/const-tuple-print-numeric-field-id branch July 21, 2026 22:08
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.

1 participant