Skip to content

Commit 4fd67b2

Browse files
authored
Merge pull request #66291 from apple/es-rdar56
Add a test for extension of a public type conforming to SPI protocol
2 parents 6eacb40 + acabced commit 4fd67b2

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

test/SPI/spi_extension.swift

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// RUN: %empty-directory(%t)
2+
// RUN: split-file %s %t
3+
4+
// RUN: %target-swift-frontend -emit-module %t/Lib.swift \
5+
// RUN: -module-name Lib -I %t \
6+
// RUN: -emit-module-path %t/Lib.swiftmodule
7+
8+
// RUN: %target-swift-frontend -typecheck -verify %t/Client.swift -I %t
9+
10+
11+
//--- Lib.swift
12+
@_spi(core)
13+
public protocol SPIProto {
14+
func foo()
15+
}
16+
17+
@_spi(core)
18+
extension SPIProto {
19+
public func foo() {}
20+
}
21+
22+
//--- Client.swift
23+
24+
@_spi(core) import Lib
25+
26+
public class Klass {}
27+
28+
@_spi(core)
29+
extension Klass: SPIProto {
30+
func bar() {}
31+
}

0 commit comments

Comments
 (0)