Commit Graph

7 Commits

Author SHA1 Message Date
Alexis Laferrière
3d611e2a85 Sema: Simplify warning about @_implementationOnly being deprecated 2024-04-22 14:44:44 -07:00
Alexis Laferrière
0a25248e4b Test: Expect warning on deprecated @_implementationOnly in tests 2024-04-22 13:08:20 -07:00
Alexis Laferrière
d221c1310f [Tests] Update tests using @_implementationOnly imports to use library-evolution 2023-07-05 16:20:42 -07:00
Slava Pestov
94e999a1b5 Sema: Pull availability checking out of resolveType()
We used to diagnose references to unavailable declarations in
two places:

- inside Exprs, right after type checking the expression
- inside TypeReprs, from resolveType()

In broad terms, resolveType() is called with TypeReprs
stored inside both Stmts and Decls.

To handle the first case, I added a new overload of
diagAvailability() that takes a Stmt, to be called from
typeCheckStmt(). This doesn't actually walk into any Exprs
stored inside the statement; this means it only walks
Patterns and such.

For the second case, a new DeclAvailabilityChecker is
now defined in TypeCheckAccess.cpp. It's structure is
analogous to the other three walkers there:

- AccessControlChecker
- UsableFromInlineChecker
- ExportabilityChecker

The new implementation of availability checking for types
introduces a lot more code than the old online logic
it replaces. However, I hope to consolidate some of the
code duplication among the four checkers that are defined
in TypeCheckAccess.cpp, and do some other cleanups that
will make the benefit of the new approach apparent.
2020-10-14 23:42:02 -04:00
Jordan Rose
326fa14f8b Don't bother checking implementation-only import use for accessors
Their associated AbstractStorageDecl is already being checked, and
will produce a better error.
2019-04-11 16:33:23 -07:00
Jordan Rose
a4606111af Adjust the implementation-only diagnostics to sound more similar
John and I had slightly different styles when adding these; better
to keep them in harmony.
2019-04-11 16:33:23 -07:00
John McCall
ae6561c32c Checks for implementation-only imports in @inlinable code.
Part of rdar://48991061
2019-04-05 16:30:25 -04:00