Skip to content

Nuke DeclChecker::IsFirstPass #15731

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

Conversation

slavapestov
Copy link
Contributor

The epic season finale of #15729.

Copy link
Contributor

@xedin xedin left a comment

Choose a reason for hiding this comment

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

Awesome!

Copy link
Member

@DougGregor DougGregor left a comment

Choose a reason for hiding this comment

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

Looks great, thank you!

@@ -527,11 +528,6 @@ static void typeCheckFunctionsAndExternalDecls(SourceFile &SF, TypeChecker &TC)
for (AbstractFunctionDecl *FD : TC.definedFunctions) {
TC.checkFunctionErrorHandling(FD);
}
for (auto decl : TC.Context.ExternalDefinitions) {
if (auto fn = dyn_cast<AbstractFunctionDecl>(decl)) {
TC.checkFunctionErrorHandling(fn);
Copy link
Member

Choose a reason for hiding this comment

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

Nice catch!

@@ -462,6 +462,18 @@ static void typeCheckFunctionsAndExternalDecls(SourceFile &SF, TypeChecker &TC)
TC.finalizeDecl(decl);
}

// Type check conformance contexts.
for (unsigned i = 0; i != TC.ConformanceContexts.size(); ++i) {
Copy link
Member

Choose a reason for hiding this comment

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

Good choice; I like doing this as a later "pass" anyway at this point, because it makes us less likely to be order-sensitive in the interim.

@slavapestov slavapestov force-pushed the decl-checker-cleanup-part-6 branch 3 times, most recently from 0ade261 to ec5946c Compare April 6, 2018 07:54
@slavapestov slavapestov force-pushed the decl-checker-cleanup-part-6 branch from ec5946c to 6f79c2f Compare April 6, 2018 07:54
I tried doing this directly from typeCheckDecl(), but it breaks
associated type inference. We can figure this out later when
declaration checking becomes lazier and more incremental.

Note that typo correction does not force witnesses of
synthesized conformances. This means that a typo correction
from a top-level form will no longer pick up synthesized
witnesses, and will find the protocol requirement instead.

To give a test the same behavior as before, I put the
expression in a function body instead of a top-level form.

Note that we already had the same behavior with typo
correction from pattern binding initializers and other
contexts that are type checked before conformances.
@slavapestov slavapestov force-pushed the decl-checker-cleanup-part-6 branch from 6f79c2f to 5e4f5a4 Compare April 6, 2018 07:56
@slavapestov
Copy link
Contributor Author

@swift-ci Please test

@slavapestov
Copy link
Contributor Author

@swift-ci Please test source compatibility

2 similar comments
@slavapestov
Copy link
Contributor Author

@swift-ci Please test source compatibility

@slavapestov
Copy link
Contributor Author

@swift-ci Please test source compatibility

@swift-ci
Copy link
Contributor

swift-ci commented Apr 6, 2018

Build failed
Swift Test OS X Platform
Git Sha - 0ade26100c7b14625ba2573193ce3ab2fc6cd73a

@slavapestov
Copy link
Contributor Author

@swift-ci Please test

@slavapestov slavapestov merged commit c35d508 into swiftlang:master Apr 6, 2018
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.

4 participants