|
22 | 22 | // RUN: %target-swift-frontend -emit-module %t/ImportUsedInPackage.swift -o %t -I %t
|
23 | 23 | // RUN: %target-swift-frontend -emit-module %t/ExportedUnused.swift -o %t -I %t
|
24 | 24 | // RUN: %target-swift-frontend -emit-module %t/SPIOnlyUsedInSPI.swift -o %t -I %t
|
| 25 | +// RUN: %target-swift-frontend -emit-module %t/RetroactiveConformance.swift -o %t -I %t |
25 | 26 |
|
26 | 27 | /// Check diagnostics.
|
27 | 28 | // RUN: %target-swift-frontend -typecheck %t/Client.swift -I %t \
|
@@ -110,6 +111,11 @@ public func packageFunc() -> PackageType { return PackageType() }
|
110 | 111 | //--- SPIOnlyUsedInSPI.swift
|
111 | 112 | public struct ToUseFromSPI {}
|
112 | 113 |
|
| 114 | +//--- RetroactiveConformance.swift |
| 115 | +public struct Extended { |
| 116 | + public var count: Int { 42 } |
| 117 | +} |
| 118 | + |
113 | 119 | //--- Client_Swift5.swift
|
114 | 120 | /// No diagnostics should be raised on the implicit access level.
|
115 | 121 | import UnusedImport // expected-error {{ambiguous implicit access level for import of 'UnusedImport'; it is imported as 'public' elsewhere}}
|
@@ -143,6 +149,7 @@ public import ImportUsedInPackage // expected-warning {{public import of 'Import
|
143 | 149 |
|
144 | 150 | @_exported public import ExportedUnused
|
145 | 151 | @_spiOnly public import SPIOnlyUsedInSPI
|
| 152 | +public import RetroactiveConformance |
146 | 153 |
|
147 | 154 | public func useInSignature(_ a: TypeUsedInSignature) {} // expected-remark {{struct 'TypeUsedInSignature' is imported via 'DepUsedInSignature'}}
|
148 | 155 | public func exportedTypeUseInSignature(_ a: ExportedType) {} // expected-remark {{struct 'ExportedType' is imported via 'Exporter', which reexports definition from 'Exportee'}}
|
@@ -228,6 +235,13 @@ package func packageFunc(a: PackageType = packageFunc()) {} // expected-remark {
|
228 | 235 | @_spi(X)
|
229 | 236 | public func spiFunc(a: ToUseFromSPI) {} // expected-remark {{struct 'ToUseFromSPI' is imported via 'SPIOnlyUsedInSPI'}}
|
230 | 237 |
|
| 238 | +public protocol Countable { |
| 239 | + var count: Int { get } // expected-remark {{struct 'Int' is imported via 'Swift'}} |
| 240 | +} |
| 241 | + |
| 242 | +extension Extended: Countable { // expected-remark {{struct 'Extended' is imported via 'RetroactiveConformance'}} |
| 243 | +} |
| 244 | + |
231 | 245 | /// Tests for imports of clang modules.
|
232 | 246 | //--- module.modulemap
|
233 | 247 | module ClangSimpleUnused {
|
|
0 commit comments