Fix PE056: Deep aggregate unwrapping for QUERY resolution#12
Merged
starseeker merged 4 commits intotreatfrom Feb 6, 2026
Merged
Fix PE056: Deep aggregate unwrapping for QUERY resolution#12starseeker merged 4 commits intotreatfrom
starseeker merged 4 commits intotreatfrom
Conversation
Co-authored-by: starseeker <238416+starseeker@users.noreply.github.com>
Co-authored-by: starseeker <238416+starseeker@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix deep aggregate unwrapping for QUERY source
Fix PE056: Deep aggregate unwrapping for QUERY resolution
Feb 6, 2026
starseeker
added a commit
that referenced
this pull request
Feb 9, 2026
* Implement deep aggregate unwrapping for QUERY resolution (PE056 fix) Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: starseeker <238416+starseeker@users.noreply.github.com>
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.
QUERY expressions failed with PE056 when the source was a named aggregate type or SELECT-of-named-aggregates. The resolver performed shallow
TYPEis_aggregate()checks that didn't unwrap through typedef chains.Changes
Added
TYPEget_aggregate_base()helperinclude/express/type.hUpdated QUERY resolution (
src/express/resolve.c)TYPEis_aggregate()withTYPEinherits_from(..., aggregate_)TYPEget_aggregate_base()to derive query variable type from named aggregatesFixed
TYPE_retrieve_aggregate()for SELECT-of-aggregatesTYPEinherits_from()+TYPEget_aggregate_base()body->typeinstead of pointer equality (different aggregate definitions create separate Type instances for the same underlying type)Test coverage
test/unitary_schemas/simple_query_test.exp- QUERY over defined aggregatetest/unitary_schemas/select_aggregate_test.exp- QUERY over SELECT-of-aggregatestest/unitary_schemas/query_named_aggregate.exp- Nested aggregatestest/buggy/expr-src-aggregate.expto passing testsOut of scope
Flow-sensitive narrowing and TREAT syntax deferred to later PRs. AP242 styled_item WR3 still fails as expected.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.