Skip to content

[Diagnostics] Mark invalid ‘@testable import’ as fatal #22191

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 1 commit into from
Jan 29, 2019

Conversation

harlanhaskins
Copy link
Contributor

If this isn’t fatal, this will just end up cascading to a bunch of “could not find member … in …” errors, which hides the real issue.

@harlanhaskins
Copy link
Contributor Author

Still needs a test.

@harlanhaskins
Copy link
Contributor Author

@jrose-apple I added a test (was not aware -verify doesn't handle fatal errors!)

Copy link
Contributor

@jrose-apple jrose-apple left a comment

Choose a reason for hiding this comment

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

Looks good. And yeah, I don't know what tricks we'd have to jump through to make -verify handle fatal errors, but at least it tells you!

@harlanhaskins
Copy link
Contributor Author

@swift-ci please smoke test

@harlanhaskins
Copy link
Contributor Author

@swift-ci please smoke test

@testable import Swift // expected-error {{module 'Swift' was not compiled for testing}}
// CHECK: module 'Swift' was not compiled for testing
// DISABLED-NOT: module 'Swift' was not compiled for testing
@testable import Swift
@testable import empty // no-error
@testable import Testable_ClangModule // no-error
Copy link
Contributor

Choose a reason for hiding this comment

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

Now these aren't being checked anymore.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How about now? I'm trying to be a bit more explicit than before.

If this isn’t fatal, this will just end up cascading to a bunch of “could not find member … in …” errors, which hides the real issue.
@harlanhaskins
Copy link
Contributor Author

@swift-ci please smoke test

@harlanhaskins harlanhaskins merged commit 0a9b8fa into swiftlang:master Jan 29, 2019
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