Commit Graph

9 Commits

Author SHA1 Message Date
Alexis Laferrière
915b1e3def Sema: Update more tests with more precise message about exported conformances 2024-06-13 15:20:18 -07:00
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
Alexis Laferrière
4d9c8ee5eb [Sema] Generalize the downgraded warning for exportability check
This warning will be used more generally so let's make bring back the
diagnostic in line with the error version.
2022-06-29 16:09:42 -07:00
Slava Pestov
5f5372a3fc Sema: Don't check SPI violations in diagnoseInlinableDeclRefAccess()
There's no need to check for that here, because we also run
diagnoseDeclRefExportability() on declarations referenced
from inlinable code.

This changes some diagnostics; we now produce the same diagnostic
for references to SPI types in declaration signatures and for
references to non-type SPI declarations in inlinable function bodies.

Also note that the old inlinable reference diagnostic no longer has
to handle the 'public' and 'open' access levels, which previously
happened for '@_spi'; so I changed those entries in the %select to
%error.
2020-10-22 01:11:46 -04: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
Alexis Laferrière
73252e8bf4 [Sema] Only warn when exporting implementation-only types in SPI
Downgrade to a warning the diagnostics on the use of an
implemenetation-only type in SPI to allow support for
-experimental-spi-imports.
2020-07-30 09:20:13 -07:00
Alexis Laferrière
08abc0dbec [Sema] Fix leak of implementation-only imported types in SPI signatures 2020-05-12 16:54:38 -07:00