Commit Graph

7 Commits

Author SHA1 Message Date
Allan Shortlidge
8e5988e5fc NFC: Increase test coverage for SPI enum elements.
These tests identified a gap in type checking the exportability of case statements. Unfortunately this gap is not simple to close, since exportability is usually checked during availability checking but availability checking isn't appropriate for case statements and there isn't existing infrastructure to check exportability independently.
2022-11-29 22:11:02 -08:00
Allan Shortlidge
c54689bf49 Test: Fix copy-pasta in spi_helper.swift by making SPIStruct type a struct instead of a class. 2022-10-21 20:59:13 -07:00
Alexis Laferrière
c22cf03530 [ASTPrinter] Fix printing inconsistent implementation-only imported in experimental mode
Make sure we print imports that are sometimes normal and sometimes
implemntation-only in the experimental SPI import mode.

rdar://89620638
2022-03-01 08:30:11 -08:00
Arnold Schwaighofer
2a2cf91dcd Add support for marking a _specialize attribute as SPI
```
  @_specialize(exported: true, spi: SPIGroupName, where T == Int)
  public func myFunc() { }
```

The specialized entry point is only visible for modules that import
using `_spi(SPIGroupName) import ModuleDefiningMyFunc `.

rdar://64993425
2020-10-12 09:19:29 -07:00
Alexis Laferrière
fd78da5137 [ModuleInterface] Don't print extensions to implementation-only imported types
Extensions to implementation-only types are accepted at type-checking
only if they don't define any public members. However if they declared a
conformance to a public type they were also printed in the
swiftinterface, making it unparsable because of an unknown type.

Still accept such extensions but don't print them.

rdar://problem/67516588
2020-08-20 17:12:31 -07:00
Alexis Laferrière
412469326d [SPI Test] Extend and update SPI tests 2020-03-04 16:43:05 -08:00
Alexis Laferrière
4d6adefa4c [Test] Test clients of modules defining SPI decls 2020-02-19 14:17:14 -08:00