Skip to content

[AST] Move generic parameter logic for accessor decl from parser to GenericParamListRequest #61429

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

Merged
merged 2 commits into from
Oct 7, 2022

Conversation

LucianoPAlmeida
Copy link
Contributor

@LucianoPAlmeida LucianoPAlmeida commented Oct 4, 2022

AbstractFunctionDecl::isGenericContext being based on getGenericParams() which is nullptr in this case for AccessorDecl because createOpaqueParameterGenericParams was not be able to create the implicit generic param list correctly because it was looking to itself but in fact it should look through subscript(storage) signature instead.

This refectors generic parameters logic for accessor declaration to be a copy of the storage at GenericParamListRequest instead of parse time. See Slava's comment bellow.

Resolves #61387

@LucianoPAlmeida
Copy link
Contributor Author

@swift-ci Please test

@LucianoPAlmeida
Copy link
Contributor Author

@swift-ci Please test

@LucianoPAlmeida
Copy link
Contributor Author

@slavapestov I think changes are ready for a re-review. Let me know if this aligns with what you were thinking

@LucianoPAlmeida LucianoPAlmeida changed the title [AST] Consider storage signature when computing opaque parameter implicit generic params [AST] Move generic parameter logic for accessor decl from parser to GenericParamListRequest Oct 7, 2022
Copy link
Contributor

@slavapestov slavapestov left a comment

Choose a reason for hiding this comment

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

Excellent!

@slavapestov slavapestov merged commit 92f1361 into swiftlang:main Oct 7, 2022
@LucianoPAlmeida LucianoPAlmeida deleted the opaque-parameters-crash branch October 8, 2022 03:24
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.

compiler crash: Functions in generic context must have an interface type
3 participants