Skip to content

Commit ba2455a

Browse files
committed
[Sema] Add test case for SPI requirements on name vs type
1 parent 5be252a commit ba2455a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

test/SPI/protocol_requirement.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ public protocol PublicProtoRejected {
77
@_spi(Private)
88
func reqWithoutDefault() // expected-error{{protocol requirement 'reqWithoutDefault()' cannot be declared '@_spi' without a default implementation in a protocol extension}}
99

10+
@_spi(Private)
11+
func reqWithSharedName(_: Int) // expected-error{{protocol requirement 'reqWithSharedName' cannot be declared '@_spi' without a default implementation in a protocol extension}}
12+
1013
@_spi(Private)
1114
var property: Int { get set } // expected-error{{protocol requirement 'property' cannot be declared '@_spi' without a default implementation in a protocol extension}}
1215

@@ -26,6 +29,9 @@ public protocol PublicProtoRejected {
2629
extension PublicProtoRejected {
2730
@_spi(Private)
2831
public var propertyWithoutSetter: Int { get { return 42 } }
32+
33+
@_spi(Private)
34+
public func reqWithSharedName(_: String) {}
2935
}
3036

3137
extension PublicProtoRejected where Self : Equatable {

0 commit comments

Comments
 (0)