And make sure that all those public identifiers are preceeded with underscores.
I marked these public-modifiers with "// @testable" to document why they are public.
If some day we have a @testable attribute it should be used instead of those public-modifiers.
Again, this is needed for enabling dead internal function elimination in the stdlib.
Swift SVN r22657
This allows UnicodeScalars to be constructed from an integer, rather
then from a string. Not only this avoids an unnecessary memory
allocation (!) when creating a UnicodeScalar, this also allows the
compiler to statically check that the string contains a single scalar
value (in the same way the compiler checks that Character contains only
a single extended grapheme cluster).
rdar://17966622
Swift SVN r21198
Keep calm: remember that the standard library has many more public exports
than the average target, and that this contains ALL of them at once.
I also deliberately tried to tag nearly every top-level decl, even if that
was just to explicitly mark things @internal, to make sure I didn't miss
something.
This does export more than we might want to, mostly for protocol conformance
reasons, along with our simple-but-limiting typealias rule. I tried to also
mark things private where possible, but it's really going to be up to the
standard library owners to get this right. This is also only validated
against top-level access control; I haven't fully tested against member-level
access control yet, and none of our semantic restrictions are in place.
Along the way I also noticed bits of stdlib cruft; to keep this patch
understandable, I didn't change any of them.
Swift SVN r19145
Really we want those nullary functions be computed properties using enums.
var _assertConfiguration : _AssertConfiguration {
let assertConfig = Int32(Builtin.assert_configuration())
if assertConfig == 0 {
return .Debug
}
if assertConfig == 1 {
return .Release
}
return .Fast
}
if _assertConfiguration == .Debug {
_fatal_error_message("assertion failed", message, file, line)
}
In my tests the enums were not optimized away. So for the short term leave
these functions as nullary functions.
Swift SVN r18211