Skip to content

Adds mapValues and compactMapValues to CxxDictionary: #83429

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

CrazyFanFan
Copy link
Contributor

No description provided.

@egorzhdan egorzhdan added the c++ interop Feature: Interoperability with C++ label Jul 30, 2025
Copy link
Contributor

@egorzhdan egorzhdan left a comment

Choose a reason for hiding this comment

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

Thanks! I have a couple of questions.

@@ -144,6 +144,58 @@ extension CxxDictionary {
}
}

public func mapValues<R, E>(
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this method also be @inlinable?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the suggestion! I've added the @inlinable attribute.

Could you please re-trigger the test job?

}

@inlinable
@_disfavoredOverload
Copy link
Contributor

Choose a reason for hiding this comment

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

Just trying to understand this better, why do we need @_disfavoredOverload on this overload?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Without @_disfavoredOverload, this method would call itself recursively by default.

@egorzhdan
Copy link
Contributor

@swift-ci please smoke test

@CrazyFanFan CrazyFanFan force-pushed the feature/cxx_map_mapvalues_and_compactmapvalues branch from cecfa9f to 4426912 Compare July 30, 2025 14:45
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