Skip to content

[XCTestCase] Workaround SR-1129 using public var #87

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

modocache
Copy link
Contributor

XCTestCase.name works around a bug in the Linux Swift compiler (SR-1129) by declaring what should be a private variable as public. XCTAllExpectations works around the same bug by using a global variable. Unify the two by using the same workaround method: declare the expectations variable as public.

Besides using the same workaround, this has the added benefit of reducing the amount of global state in XCTest.

@mike-ferris
Copy link

@swift-ci please test

@mike-ferris
Copy link

This looks like a good change and worth the "public" workaround for avoiding global state.

@briancroom
Copy link
Contributor

How about prefixing the property name with an underscore for now to help reinforce its intended private-ness and reduce the chance of a naming collision, since the class is intended to be subclassed?

`XCTestCase.name` works around a bug in the Linux Swift compiler by
declaring what should be a `private` variable as `public`.
`XCTAllExpectations` works around the same bug by using a global
variable. Unify the two by using the same workaround method: declare
the expectations variable as `public`.
@modocache modocache force-pushed the instance-variable-for-expectations branch from 6b84a16 to 27ba48e Compare April 4, 2016 14:53
@modocache modocache merged commit e74dea1 into swiftlang:master Apr 4, 2016
@modocache modocache deleted the instance-variable-for-expectations branch April 4, 2016 14:54
@modocache
Copy link
Contributor Author

@briancroom Done! Good suggestion, thanks!

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.

3 participants