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

Add a few diagnostics for variadic generic types #65767

Merged

Conversation

slavapestov
Copy link
Contributor

A variadic generic type cannot declare more than one pack in its generic parameter list. This is an intentional restriction in the design.

Also the current implementation does not support variadic enums, or inheritance from variadic classes. These last two will go away eventually.

@slavapestov slavapestov force-pushed the variadic-generic-diagnostics branch from 104af9f to 8f71dc9 Compare May 8, 2023 16:57
@slavapestov
Copy link
Contributor Author

@swift-ci Please test

@@ -5432,7 +5438,7 @@ ERROR(pack_reference_must_be_in_expansion,none,
"pack reference %0 requires expansion using keyword 'repeat'",
(TypeRepr*))
ERROR(pack_type_requires_keyword_each,none,
"pack type %0 must be referenced with 'each'",
"type pack %0 must be referenced with 'each'",
Copy link
Contributor

Choose a reason for hiding this comment

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

Heh, I have made this change in #65718 too

@slavapestov slavapestov merged commit fdeb0e5 into swiftlang:main May 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants