Skip to content

Commit 961b76a

Browse files
committed
The -disable-access-control flag should not be combined with strict safety checking
Thank you, Gabor!
1 parent 312dc56 commit 961b76a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

proposals/nnnn-strict-memory-safety.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,8 @@ All of these APIs will be marked `@unsafe`. For all of the types that are `@unsa
241241

242242
The `-Ounchecked` compiler flag disables some checking in the standard library, including (for example) bounds checking on array accesses. It is generally discouraged in all Swift code, but is particularly problematic in conjunction with strict memory safety because it removes the checking that makes certain standard library APIs safe. Therefore, the compiler will produce a diagnostic when the two features are combined.
243243

244+
The `-disable-access-control` flag ignores access specifiers entirely, allowing one to (for example) access a `private` declaration from outside its defining file. This could allow one to break invariants of a type that can lead to memory-safety issues, such as breaking the invariant of `Range` that the lower bound not exceed the upper bound. The compiler will produce a diagnostic when the two features are combined.
245+
244246
### Unsafe overrides
245247

246248
Overriding a safe method within an `@unsafe` one could introduce unsafety, so it will produce a diagnostic in the strict safety mode:

0 commit comments

Comments
 (0)