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

Don't compare witnesses when deducing through FacetValue #5179

Closed
wants to merge 1 commit into from

Conversation

danakj
Copy link
Contributor

@danakj danakj commented Mar 25, 2025

As long as the types (FacetTypes) of the FacetValue match, any witnesses that are present should be accepted for deduce.

If the parameter's witnesses are concrete, the argument's will also be concrete and the exact same values. This is what we have relied on so far.

If the parameter's witnesses are symbolic, the argument may have either symbolic or concrete witnesses. If they are symbolic then they are equal. If they are concrete then they are not equal (and will fail deduction if compared. But the argument FacetValue with a concrete witness brings more information than the parameter has, and can be used in place of the parameter's FacetValue.

All FacetValues have some witness for every interface in the facet's type (FacetType), so there's no question of whether a witness is present or not between the parameter and argument.

This ensures that the deduction test with a nested FacetValue in a specific block continues to pass when generic witness resolution can produce a FacetValue with a symbolic witness in #5169.

See issue #5178 for more details.

As long as the types (FacetTypes) of the FacetValue match, any witnesses
that are present should be accepted for deduce.

If the parameter's witnesses are concrete, the argument's will also be
concrete and the exact same values. This is what we have relied on so
far.

If the parameter's witnesses are symbolic, the argument may have either
symbolic or concrete witnesses. If they are symbolic then they are
equal. If they are concrete then they are not equal (and will fail
deduction if compared. But the argument FacetValue with a concrete
witness brings more information than the parameter has, and can be
used in place of the parameter's FacetValue.

All FacetValues have _some_ witness for every interface in the facet's
type (FacetType), so there's no question of whether a witness is present
or not between the parameter and argument.

This ensures that the deduction test with a nested FacetValue in a
specific block continues to pass when generic witness resolution can
produce a FacetValue with a symbolic witness in carbon-language#5169.

See issue carbon-language#5169 for more details.
@danakj
Copy link
Contributor Author

danakj commented Mar 25, 2025

No longer needed: #5178 (comment)

@danakj danakj closed this Mar 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant