Skip to content

[cxx-interop] Apply typedef -> enum patch to method param types as well. #42452

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

zoecarver
Copy link
Contributor

Basically just applying #42431 to ObjC method param types.

@zoecarver zoecarver added the c++ interop Feature: Interoperability with C++ label Apr 19, 2022
@zoecarver zoecarver requested a review from plotfi April 19, 2022 19:04
@zoecarver
Copy link
Contributor Author

@swift-ci please test.

@zoecarver
Copy link
Contributor Author

@swift-ci Please Test Source Compatibility

@@ -2847,7 +2865,21 @@ ImportedType ClangImporter::Implementation::importMethodParamsAndReturnType(
ImportTypeKind importKind = ImportTypeKind::Parameter;
ImportDiagnosticAdder paramAddDiag(*this, clangDecl, param->getLocation());
Type swiftParamTy;
bool paramIsIUO;
bool paramIsIUO = false;
if (auto typedefType = dyn_cast<clang::TypedefType>(paramTy.getTypePtr())) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this and the previous addition be merged into one function or lambda?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea. I will do it in a follow-up nfc.


// CHECK: class ColorMaker {
// CHECK: class func makeColor(withOptions opts: SOColorMask)
// CHECK: func makeColor(withOptions opts: SOColorMask)
Copy link
Contributor

Choose a reason for hiding this comment

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

I suspect you will have to update these now that #42412 is merged.

@zoecarver
Copy link
Contributor Author

Windows test failures are unrelated. Merging.

@zoecarver zoecarver merged commit 5be506e into swiftlang:main Apr 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ interop Feature: Interoperability with C++
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants