Files
swift-mirror/test/ClangImporter/availability_spi_transitive.swift
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

9 lines
426 B
Swift

// REQUIRES: OS=macosx
// RUN: %target-swift-frontend -typecheck %s -F %S/Inputs/frameworks -verify -verify-ignore-unrelated -library-level api
import SPIContainerImporter
@_spi(a) public let a: SPIInterface1
public let c: SPIInterface1 // expected-error{{cannot use class 'SPIInterface1' in a property declaration marked public or in a '@frozen' or '@usableFromInline' context; it is an SPI imported from 'SPIContainer'}}