Commit Graph

6 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
Henrik G. Olsson
cbc0ec3b88 Add -verify-ignore-unrelated where necessary (NFC)
These are tests that fail in the next commit without this flag. This
does not add -verify-ignore-unrelated to all tests with -verify, only
the ones that would fail without it. This is NFC since this flag is
currently a no-op.
2025-10-04 14:19:52 -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
bc4efe518f [Sema] Always error on public uses of conformance from @_spiOnly import 2022-09-09 09:50:56 -07:00
Alexis Laferrière
d1e36b0a12 [Sema|lit] Intro lit substitution for generating the 2 swiftinterfaces
Intro the lit substitution
`%target-swift-emit-module-interfaces(Main.swiftinterface,
Main.private.swiftinterface` to generate both the public and private
swiftinterface. And use it in spi-only-import-exportability.swift.

To verify the generated interfaces I would recommend to keep two calls
to `%target-swift-typecheck-module-from-interface` as each is a
different invocation likely to fail.
2022-09-09 09:20:51 -07:00
Alexis Laferrière
6d396b4834 [Sema] Check @_spiOnly imported decls exportability
Decls imported via an @_spiOnly import can only be used in @_spi decls
signatures, internal decl signatures and non-inlinable function bodies.
2022-09-09 09:20:51 -07:00