Swiftc flag to set default visibility level

I prefer private as the default visibility level, both because it's more convenient (most things end up being private) and because it encourages developers to keep visibility to a minimum. What if there was a flag for swiftc to set the default visibility level, so that developers could set it to private?

We try very hard not to create "dialects" of Swift where seemingly valid code can be rejected based on compiler flags or other information that isn't visible in the source file. We unfortunately don't always succeed—resilience and language version both come from compiler flags—but we only do that when one of the language's goals demands it.

Terms of Service

Privacy Policy

Cookie Policy