Skip to content

Fixing various regressions #12595

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 Oct 24, 2017

While testing a user project against the master branch I found a large number of regressions. This PR collects fixes for them. A few I was not able to address but we're tracking them internally.

for (auto param : params) {
auto clangTy = IGM.getClangType(param);
paramTys.push_back(clangTy);
auto canClangTy = IGM.getClangASTContext().getCanonicalParamType(clangTy);
paramTys.push_back(canClangTy);
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 the better fix here might be to call getUnqualifiedType in ClangTypeConverter::convert's code for getting the type out of a clang::TypeDecl.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, I'll take a look tomorrow.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, that made the change a bit simpler. PTAL

@slavapestov
Copy link
Contributor Author

@CodaFi You might be interested in the parser change for __shared and __owned.

@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@@ -34,6 +34,7 @@
#include "swift/AST/ProtocolConformance.h"
#include "swift/Basic/Compiler.h"
#include "swift/Basic/SourceManager.h"
#include "swift/Parse/Token.h"
Copy link
Contributor

Choose a reason for hiding this comment

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

How is this better? Just fewer includes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, editing Token.h does not trigger recompilation of ~400 source files anymore.

@slavapestov slavapestov force-pushed the impressive-endless-regressions branch from 8076a33 to a2807bf Compare October 25, 2017 01:16
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov slavapestov force-pushed the impressive-endless-regressions branch from a2807bf to 5aac811 Compare October 25, 2017 03:10
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

2 similar comments
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@CodaFi
Copy link
Contributor

CodaFi commented Oct 25, 2017

If __shared and __owned are contextual keywords, there shouldn't be anything stopping inout from being given the same treatment.

@slavapestov
Copy link
Contributor Author

slavapestov commented Oct 25, 2017

@CodaFi inout has legacy behavior where it can appear before a parameter name. I think that's just a hard error now, so if we're OK with losing that, we could make it a contextual keyword. But as @jrose-apple pointed out offline, contextual keywords make error recovery more difficult, so unless we feel there's something to be gained by allowing inout to be used as an identifier, I don't see any reason to do that. I also feel that if we had shared and owned as keywords from the start, they would not need to be contextual, but at this point in time we have source compatibility concerns. That's my only reason for changing this.

Otherwise, a protocol conformance where the witness was a dynamic
property in another module would trigger an assertion while building
the materializeForSet witness, or miscompile and fail at runtime
if asserts are off.
getFormalTypeInContext() was using the context archetypes of the
original parent type, and not the extension.
... or something. This manifested as a crash when emitting an @objc thunk
for an NS_STRING_ENUM type.

Fixes <rdar://problem/35140812>.
This code path is only used for a special purpose hack to make
NSString members available on String. Since it is rarely
exercised, it was broken.
This was a source compatibility regression, someone actually had
an identifier named __shared.
@slavapestov slavapestov force-pushed the impressive-endless-regressions branch from 5aac811 to 93c80da Compare October 25, 2017 03:45
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

1 similar comment
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test Linux

@slavapestov
Copy link
Contributor Author

@shahmishal Any ideas what's going on here?

 > git --version # timeout=10
 > git fetch --tags --progress [email protected]:apple/swift.git +refs/pull/*:refs/remotes/origin/pr/*
ERROR: Timeout after 10 minutes
ERROR: Error fetching remote repo 'origin'
hudson.plugins.git.GitException: Failed to fetch from [email protected]:apple/swift.git

@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test Linux

@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test Linux

@slavapestov slavapestov merged commit 9de8200 into swiftlang:master Oct 25, 2017
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