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

"Extended attributes associated with ..." omits UnionMemberType first alt? #867

Open
bathos opened this issue Apr 5, 2020 · 2 comments
Open

Comments

@bathos
Copy link
Contributor

bathos commented Apr 5, 2020

The section describing annotated types provides a set of rules for determining which extended attributes are associated with a type (which is then the inner type of an annotated type). From a grammar POV, I think the cases it looks at are:

  • Step 2: TypeWithExtendedAttributes
  • Step 3: TypeWithExtendedAttributes again, but where Type is UnionType Null
  • Step 4: Argument
  • Step 5: DictionaryMember
  • Step 6: TypeWithExtendedAttributes again, but via TypeDef reference

None of these cases appears to cover the first alternative of UnionMemberType:

  • ExtendedAttributeList DistinguishableType

That is, the grammar allows for ([Attr] Type1 or Type2) via that alternative, but I don’t think the “extended attributes associated with” set will actually end up including [Attr] for Type1 if these rules are followed as written. At a glance, it might look like step 3 touches on this case — but step 3 only seems to describe the propagation of the attr of [Attr] (union here) to each of the union’s members.

Logically, the ExtendedAttributeList DistinguishableType alternative is the same idea as TypeWithExtendedAttributes but with a narrower set of possible types, so it looks like handling of this case might have been lost inadvertently in a past refactor or something.

@domenic
Copy link
Member

domenic commented Apr 5, 2020

There are a number of open issues about this feature; this seems to be very related to #827.

@bathos
Copy link
Contributor Author

bathos commented Apr 5, 2020

Thanks. It does seem related insofar as they both pertain to extended attributes which are (or should be) associated with individual members of a union. AFAICT don’t think they overlap though — I’m pretty sure the issue I’ve described here is a straight-up omission of something that was meant to exist (because as written, the ExtendedAttributeList of ExtendedAttributeList DistinguishableType just disappears into the void, and is not actually associated with anything).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants