@@ -169,61 +169,29 @@ and compile that product module with testing enabled.
169169## Access Control Syntax
170170
171171Define the access level for an entity by placing
172- one of the ` open ` , ` public ` , ` internal ` , ` fileprivate ` , or ` private ` modifiers
172+ one of the modifiers listed in < doc:AccessControl#Access-Levels > ,
173+ such as ` public ` or ` private ` ,
173174at the beginning of the entity's declaration.
175+ For example:
174176
175177``` swift
176- open class SomeOpenClass {}
177178public class SomePublicClass {}
178- internal class SomeInternalClass {}
179- fileprivate class SomeFilePrivateClass {}
180- private class SomePrivateClass {}
181-
182- open var someOpenVariable = 0
183- public var somePublicVariable = 0
184- internal let someInternalConstant = 0
185- fileprivate func someFilePrivateFunction () {}
179+ internal struct SomeInternalStruct () {}
186180private func somePrivateFunction () {}
187181```
188182
189- <!--
190- - test: `accessControlSyntax`
191-
192- ```swifttest
193- -> open class SomeOpenClass {}
194- -> public class SomePublicClass {}
195- -> internal class SomeInternalClass {}
196- -> fileprivate class SomeFilePrivateClass {}
197- -> private class SomePrivateClass {}
198-
199- -> open var someOpenVariable = 0
200- -> public var somePublicVariable = 0
201- -> internal let someInternalConstant = 0
202- -> fileprivate func someFilePrivateFunction() {}
203- -> private func somePrivateFunction() {}
204- ```
205- -->
206-
207- Unless otherwise specified, the default access level is internal,
183+ The code above declares ` SomePublicClass ` as public,
184+ ` SomeInternalStruct ` as internal,
185+ and ` somePrivateFunction() ` as private.
186+ If you don't write an explicit access level,
187+ the default access level modifier is ` internal ` ,
208188as described in < doc:AccessControl#Default-Access-Levels > .
209- This means that ` SomeInternalClass ` and ` someInternalConstant ` can be written
210- without an explicit access-level modifier,
211- and will still have an access level of internal:
189+ For example, in the code below, ` SomeInternalStruct ` is implicitly internal:
212190
213191``` swift
214- class SomeInternalClass {} // implicitly internal
215- let someInternalConstant = 0 // implicitly internal
192+ struct SomeInternalStruct () {}
216193```
217194
218- <!--
219- - test: `accessControlDefaulted`
220-
221- ```swifttest
222- -> class SomeInternalClass {} // implicitly internal
223- -> let someInternalConstant = 0 // implicitly internal
224- ```
225- -->
226-
227195## Custom Types
228196
229197If you want to specify an explicit access level for a custom type,
0 commit comments