-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Make BindSymbolicName the canonical form of a FacetValue wrapping the BindSymbolicName #6107
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
Make BindSymbolicName the canonical form of a FacetValue wrapping the BindSymbolicName #6107
Conversation
24137ba
to
66a28e9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New test looks good but I think theres'a bug to be fixed here too.
PTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks! I assume the new test also passes with the shortcut removed now? [Edit: I see you mentioned that it does in another comment]
Co-authored-by: Richard Smith <[email protected]>
If a
BindSymbolicName
is converted totype
and then to its exactFacetType
, we get aFacetValue
wrapping theBindSymbolicName
but providing no different information: it has the same witnesses andFacetType
as the originalBindSymbolicName
. Yet it is a different constant value, creating multiple canonical forms with the same meaning. Now we make thatFacetValue
with the sameFacetType
as theBindSymbolicName
it wraps evaluate back to theBindSymbolicName
, making it the unique canonical form.This makes the "shortcut" in convert for avoiding impl lookup when converting from
FacetAccessType
toFacetType
in this exact scenario work the same as doing the full impl lookup.