Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

decoder: Adjust Expression.ReferenceTargets() address arguments #196

Merged
merged 2 commits into from
Jan 26, 2023

Conversation

radeksimko
Copy link
Member

@radeksimko radeksimko commented Jan 25, 2023

As discovered while implementing this method for List

we will need to pass around an address which may not necessarily refer to the attribute as whole, but different expressions depending on levels of nesting.

This is expected to be useful for most other constraints which can have reference targets inside (e.g. Object or Map).

This also adds some compilation-time tests to ensure that we don't accidentally change interface somewhere and "turn off" collection of origins or targets.

@radeksimko radeksimko added enhancement New feature or request technical-debt labels Jan 25, 2023
@radeksimko radeksimko self-assigned this Jan 25, 2023
@radeksimko radeksimko force-pushed the f-expr-adjust-ref-targets-iface branch 4 times, most recently from c02bab0 to 27fef7b Compare January 25, 2023 12:28
@radeksimko radeksimko marked this pull request as ready for review January 25, 2023 12:35
@radeksimko radeksimko requested a review from a team as a code owner January 25, 2023 12:35
@radeksimko radeksimko marked this pull request as draft January 25, 2023 13:55
@radeksimko radeksimko force-pushed the f-expr-adjust-ref-targets-iface branch 2 times, most recently from 76f1570 to 7369f1d Compare January 25, 2023 14:17
@radeksimko radeksimko marked this pull request as ready for review January 25, 2023 16:02
@radeksimko radeksimko force-pushed the f-expr-adjust-ref-targets-iface branch from 7369f1d to 3075269 Compare January 25, 2023 16:10
Copy link
Member

@dbanck dbanck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, while mildly confusing

We use address as a name for a lot of things: AttributeAddrSchema, lang.Address, schema.Address

@radeksimko
Copy link
Member Author

We use address as a name for a lot of things: AttributeAddrSchema, lang.Address, schema.Address

Yeah, fair point. I think it was an act of balancing "easy to type" vs "easy to read" vs meaning. We could possibly call lang.Address => lang.ResolvedAddress and schema.Address => schema.AddressSchema, but I can't think of any simple way to get rid of the "address" in those.

For AttributeAddrSchema we could play with some combinations of target, or targetable, but nothing better comes up to mind right now.

All in all I agree it's not ideal, we can revisit later.

@radeksimko radeksimko merged commit 31ff628 into main Jan 26, 2023
@radeksimko radeksimko deleted the f-expr-adjust-ref-targets-iface branch January 26, 2023 06:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request technical-debt
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants