You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@_spi(S)publicfunc useOfSPITypeOk(_ p0:SPIProtocol, p1:SPIClass)->SPIClass{fatalError()} // OK
21
-
publicfunc useOfSPITypeInvalid()->SPIClass{fatalError()} // expected-error {{function cannot be declared public because its result uses an '@_spi' type}}
22
-
@_spi(S)publicfunc spiUseOfInternalType()->InternalClass{fatalError()} // expected-error{{function cannot be declared '@_spi' because its result uses an internal type}}
23
-
@_spi(S)publicfunc spiUseOfPrivateType(_ a:PrivateClass){fatalError()} // expected-error{{function cannot be declared '@_spi' because its parameter uses a private type}}
21
+
publicfunc useOfSPITypeInvalid()->SPIClass{fatalError()} // expected-error {{cannot use class 'SPIClass' here; it is SPI}}
22
+
@_spi(S)publicfunc spiUseOfInternalType()->InternalClass{fatalError()} // expected-error{{function cannot be declared public because its result uses an internal type}}
23
+
@_spi(S)publicfunc spiUseOfPrivateType(_ a:PrivateClass){fatalError()} // expected-error{{function cannot be declared public because its parameter uses a private type}}
24
24
25
25
@inlinable
26
26
func inlinable()->SPIClass{ // expected-error {{class 'SPIClass' is '@_spi' and cannot be referenced from an '@inlinable' function}}
@_spi(S)publicclassBadSubclass:InternalClass{} // expected-error{{class cannot be declared public because its superclass is internal}}
43
43
@_spi(S)publicclassOkSPISubclass:SPIClass{} // OK
44
-
publicclassBadPublicClass:SPIClass{} // expected-error {{class cannot be declared public because its superclass is '@_spi'}}
44
+
publicclassBadPublicClass:SPIClass{} // expected-error {{cannot use class 'SPIClass' here; it is SPI}}
45
45
@_spi(S)publicclassBadSPIClass:PrivateClass{} // expected-error {{class cannot be declared public because its superclass is private}}
46
46
47
47
@_spi(s)publicfunc genFunc<T:PrivateProtocol>(_ t:T){} // expected-error {{global function cannot be declared public because its generic parameter uses a private type}}
48
-
publicfunc genFuncBad<T:SPIProtocol>(_ t:T){} // expected-error {{global function cannot be declared public because its generic parameter uses an '@_spi' type}}
48
+
publicfunc genFuncBad<T:SPIProtocol>(_ t:T){} // expected-error {{cannot use protocol 'SPIProtocol' here; it is SPI}}
49
49
@_spi(S)publicfunc genFuncSPI<T:SPIProtocol>(_ t:T){} // OK
50
50
51
51
@_spi(S)privatefunc privateCantBeSPI(){} // expected-error{{private global function cannot be declared '@_spi' because only public and open declarations can be '@_spi'}} {{1-10=}}
52
52
@_spi(S)func internalCantBeSPI(){} // expected-error{{internal global function cannot be declared '@_spi' because only public and open declarations can be '@_spi'}} {{1-10=}}
53
+
54
+
publicstructPublicStructWithProperties{
55
+
publicvara:SPIClass // expected-error {{cannot use class 'SPIClass' here; it is SPI}}
56
+
publicvarb=SPIClass() // expected-error {{cannot use class 'SPIClass' here; it is SPI}}
0 commit comments