[swift-evolution] adding automated-testing of uncompilable features in XCTest
bspratling at mac.com
Thu Dec 15 00:16:21 CST 2016
Thanks, I’ll consider this as an alternative.
I don’t see that this solves the issues of whether a property on a class is let, however.
> On Dec 14, 2016, at 11:41 PM, Derrick Ho <wh1pch81n at gmail.com> wrote:
> You might be able to ensure access modifiers by using protocols.
> If you want to ensure that a class has a property called foo that is private you can make a private protocol that specifies a private property called foo.
> This isn't a XCTest but it is a compile time check. If a programmer tries to change a private property to public then the the compiler will complain.
> The same can be done with final. Make a protocol with a static method.
More information about the swift-evolution