Commit Graph

11 Commits

Author SHA1 Message Date
Alexis Laferrière
2d339c1260 Sema: Custom diagnostic for var decls referencing a restricted type
Replace the `here` part of the generic exportability diagnostic for
variables with: `in a property declaration marked public or in a
'@frozen' or '@usableFromInline' context`.

The full diagnostic now looks like:
```
error: cannot use struct 'ImportedType' in a property declaration marked
public or in a '@frozen' or '@usableFromInline' context;
'HiddenDependency' has been imported as implementation-only
```

This should be improved further to support implicitly exported memory
layouts in non-library-evolution and embedded.
2025-10-21 11:30:52 -07:00
Allan Shortlidge
ac8aec32ea Sema: Correct the decl kind in a resilience diagnostic.
Not everything is a type, type checker.
2024-10-26 09:26:39 -07:00
Allan Shortlidge
7e6e8ed7b5 Sema: Fully check the availability of wrappedValue.
Call `checkDeclarationAvailability()`, instead of just diagnosing
unavailability.
2024-10-25 16:50:20 -07:00
Alexis Laferrière
915b1e3def Sema: Update more tests with more precise message about exported conformances 2024-06-13 15:20:18 -07:00
Harlan Haskins
4ac34a40ea @retroactive conformance syntax and checking (#36068) 2023-10-20 14:27:03 -07:00
Slava Pestov
6934857417 Sema: Tweak associated conformance exportability diagnostics
Let's point out the associated type with a separate note, so
that we can diagnose other availability failures, such as
deprecation and OS version availability.
2020-11-09 23:43:51 -05:00
Slava Pestov
587a8dafb9 Sema: Don't forget to visit conformances introduced by non-generic types
Even if a nominal type does not have its own generic parameters,
we need to visit its conformances, because it might be defined
in a constrained extension or have a 'where' clause of its own.
2020-10-22 02:07:06 -04:00
Slava Pestov
fa50221d35 Sema: Use VarDecl::isLayoutExposedToClients() when checking VarDecl exportability 2020-10-22 01:45:56 -04:00
Slava Pestov
78d2cf2ee9 Sema: Teach ExportContext to compute whether we're inside an implicit declaration 2020-10-20 23:39:05 -04:00
Slava Pestov
f48aa51884 Sema: Remove ExportabilityChecker
Availability checking already knows how to check exportability for
types and conformances referenced from inlinable function signatures
and bodies.

Let's generalize this to work on non-inlinable function signatures
as well, allowing us to get rid of the ExportabilityChecker altogether.
2020-10-20 01:00:43 -04:00
Alexis Laferrière
3acbd0917e [Sema] Type-check exportability of SPI conformances
Report the use of conformances declared as SPI in public declarations
and inlinable code.

rdar://problem/66659715
2020-09-01 11:11:26 -07:00