Skip to content

AST: GenericSignatures don't contain type variables #38763

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

Conversation

slavapestov
Copy link
Contributor

No description provided.

@slavapestov slavapestov requested a review from CodaFi August 5, 2021 18:39
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov
Copy link
Contributor Author

@swift-ci Please test source compatibility

return AllocationArena::Permanent;

if (genericSig.hasTypeVariable()) {
assert(false && "Unsubstituted type variable leaked into generic signature");
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we preserve this assert anywhere else?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, GenericSignature::get() on ASTContext.cpp line 4476. That seems to be the only entry point where we actually create new signatures, so I thought that was the best place to put it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I actually added that assert recently in 02db632, but kept the remaining logic around until I could do more tests. You re-worded it in 74b6535 :-)

@slavapestov slavapestov merged commit 894b1ba into swiftlang:main Aug 6, 2021
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