Skip to content

[ParseableInterface] Fix failing to build a module when the importing file has errors. #22476

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

nathawes
Copy link
Contributor

@nathawes nathawes commented Feb 8, 2019

We were checking the parent invocation's DiagnosticEngine rather than the sub-instance's to determine if there were any errors building the module, which meant we would fail to load the module if there were errors prior to the import statement in the importing file.

This also meant code completion would fail to load the module, because it always emits a bogus error in order to mark the AST as erroneous so that different parts of the compiler (e.g. the verifier) have less strict assumptions.

rdar://problem/43906499

… file has errors.

We were checking the parent invocation's DiagnosticEnginer rather than the
subinstance's to determine if there were any errors building the module, which
meant we would fail to load the module if there were errors prior to the import
statement in the importing file.

This also meant code completion would fail to load the module, because it always
emits a bogus error in order to mark the AST as erroneous so that different
parts of the compiler (e.g. the verifier) have less strict assumptions.

rdar://problem/43906499
@nathawes
Copy link
Contributor Author

nathawes commented Feb 8, 2019

@swift-ci please smoke test

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.

Oops. I'm guessing at one point before ForwardingDiagnosticConsumer we were just sharing engines; this makes more sense!

@nathawes
Copy link
Contributor Author

nathawes commented Feb 8, 2019

@swift-ci smoke test

@harlanhaskins
Copy link
Contributor

@swift-ci please smoke test

2 similar comments
@nathawes
Copy link
Contributor Author

nathawes commented Feb 9, 2019

@swift-ci please smoke test

@nathawes
Copy link
Contributor Author

@swift-ci please smoke test

@nathawes nathawes merged commit dd52105 into swiftlang:master Feb 11, 2019
@nathawes nathawes deleted the sourcekit-support-for-parseable-interfaces branch February 11, 2019 18:20
@jrose-apple
Copy link
Contributor

@nathawes Brent had to revert this because the test failed on the 32-bit iOS simulator.

@nathawes
Copy link
Contributor Author

Thanks – I'll take a look today.

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