Skip to content

Index: Don't crash if an optional requirement is missing its witness #19378

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

@slavapestov slavapestov commented Sep 19, 2018

Possibly fixes rdar://problem/44499860.

@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

// RUN: %target-swift-ide-test -print-indexed-symbols -source-filename %s

// Let's just make sure this doesn't crash for now; there's nothing interesting
// to see in the output here.
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick: validation-test, then?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We might add more test cases later, with CHECK lines.

Copy link
Contributor

Choose a reason for hiding this comment

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

If you add at least a single CHECK line it will be useful to serve as a sanity check that AST walking did take place.

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’ll add a non-optional requirement and check that the witness got walked.

@@ -0,0 +1,12 @@
// RUN: %target-swift-ide-test -print-indexed-symbols -source-filename %s
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this needs REQUIRES: objc_interop.
Also if import Foundation is required to be in the test case, I'd suggest to change to // RUN: %target-swift-ide-test(mock-sdk: %clang-importer-sdk)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You’re right, thanks.

@slavapestov slavapestov force-pushed the index-while-building-crash branch from 22cf003 to 28c5ad3 Compare September 19, 2018 04:00
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov slavapestov merged commit 815310a into swiftlang:master Sep 19, 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.

3 participants