Skip to content

Tweak Parse and SILGen to support loading swiftinterface files #18764

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 5 commits into from
Aug 17, 2018

Conversation

jrose-apple
Copy link
Contributor

Handle accessors, initializers, and deinitializers without bodies, which will all appear in textual interface files.

We're going to do need to do more here for inlinable accessors, which
/do/ have bodies, but this helps us get to a bare minimum testing
configuration.
@jrose-apple
Copy link
Contributor Author

@swift-ci Please smoke test

@@ -778,7 +778,7 @@ void SILGenModule::emitConstructor(ConstructorDecl *decl) {

// If this constructor was imported, we don't need the initializing
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you update this comment to account for the behavior change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Heh, I was banking on the double meaning of "imported", but you're right.

@jrose-apple
Copy link
Contributor Author

@swift-ci Please smoke test

@jrose-apple
Copy link
Contributor Author

Whoops, this breaks deinit \n override func test().

@jrose-apple
Copy link
Contributor Author

@swift-ci Please smoke test

@jrose-apple
Copy link
Contributor Author

…still got it wrong. I should just run the full test suite locally before the next try.

The presence of a deinitializer will eventually indicate whether a
class's deinitializer is non-trivial for non-resilient modules.

Also improve recovery for normal source files for various bad ways
of declaring a deinitializer.
@jrose-apple
Copy link
Contributor Author

@swift-ci Please smoke test

I was surprised to see this parses fine already, but SILGen still
needs a new check.
This is not an exhaustive test of language features, but it at
least checks that the simple stuff is working.
@jrose-apple
Copy link
Contributor Author

@swift-ci Please smoke test

@@ -17,8 +17,8 @@ struct FooStructConstructorC {

struct FooStructDeinitializerA {
deinit // expected-error {{expected '{' for deinitializer}}
deinit x // expected-error {{deinitializers cannot have a name}} {{10-12=}}
deinit x() // expected-error {{deinitializers cannot have a name}} {{10-11=}}
deinit x // expected-error {{deinitializers cannot have a name}} {{10-12=}} expected-error {{expected '{' for deinitializer}}
Copy link
Contributor

Choose a reason for hiding this comment

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

Small drive-by diagnostic improvement too!

@jrose-apple jrose-apple merged commit 38e88d8 into swiftlang:master Aug 17, 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.

2 participants