Skip to content

Finish killing multiple parameter lists #18139

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

Final installment in the series after #18128.

In a few places I had to hack things up a bit because the multiple parameter list and uncurry level terminology is so ingrained, in particular in CSDiag. We can clean this up later.

Fixes https://bugs.swift.org/browse/SR-5832.

A better approach would be to split off ASTScopeKind::AbstractFunctionSelf
from ASTScopeKind::AbstractFunctionParams, but for now, hack things up at
the boundary to match the old behavior.
… subclasses

Now, an AbstractFunctionDecl always stores a single parameter list.

Furthermore, ConstructorDecl and DestructorDecl always store a
ParamDecl for 'self'.

FuncDecl only has a 'self' if it is a member of a nominal type or
extension, so we tail-allocate the storage for it.
@slavapestov
Copy link
Contributor Author

@swift-ci Please test

@slavapestov
Copy link
Contributor Author

@swift-ci Please test source compatibility

@@ -617,27 +617,51 @@ ASTScope *ASTScope::createRoot(SourceFile *sourceFile) {
return scope;
}

// FIXME: This is a vestige of multiple parameter lists.
static ParamDecl *getParameter(AbstractFunctionDecl *func,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@DougGregor I feel really guilty about this :( Sorry about that. I hope one of us finds time to work on ASTScope one day!

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 90cd772

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 90cd772

@slavapestov
Copy link
Contributor Author

apple/swift-lldb#787
@swift-ci Please test

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