-
-
Notifications
You must be signed in to change notification settings - Fork 600
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
Make Expectation constructor public #531
Conversation
Some libraries (like `RxNimble`) create their own expectations. This [extension from RxNimble](https://github.com/RxSwiftCommunity/RxNimble/blob/602c14aae95db274004cc77ff1779a5feaf6f6fc/Source/Expectation%2BExt.swift#L4-L6) seems to have worked in earlier versions of Swift but not anymore: > Initializer for struct 'Expectation<T>' must use "self.init(...)" or "self = ..." because it is not in module 'Nimble'
This stopped working in Swift 4.1 because of SE-0189: Restrict Cross-module Struct Initializers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to me! Will wait for another member of the team to merge.
Dropped the checkboxes from the PR description so that it looks more mergeable from the list. |
@ashfurrow Is there anyone I could ping on this? |
@Quick/core This looks good to go, pretty small, additive change. Any objections to merging? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense 👍
Could we get a new release to get this fix please? |
Please follow #575. |
Make Expectation constructor public
Some libraries (like
RxNimble
) create their own expectations. The following excerpt from RxNimble looks like a workaround to the lack of a public constructor:But in current Swift versions this does not work anymore:
That of course is not possible as the constructor is not public.
Not sure if this should be a patch or minor version bump.