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 internal type}} // TODO misleading "internal" message
22
-
@_spi(S)publicfunc spiUseOfInternalType()->InternalClass{fatalError()} // expected-error{{function cannot be declared '@_spi' because its result uses an internal type without a compatible '@_spi'}}
23
-
@_spi(S)publicfunc spiUseOfPrivateType(_ a:PrivateClass){fatalError()} // expected-error{{function cannot be declared public because its parameter uses a private type}}
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}}
24
24
25
25
@inlinable
26
-
func inlinable()->SPIClass{ // expected-error {{class 'SPIClass' is internal and cannot be referenced from an '@inlinable' function}}
27
-
spiFunc() // expected-error {{global function 'spiFunc()' is internal and cannot be referenced from an '@inlinable' function}}
28
-
_ =SPIClass() // expected-error {{class 'SPIClass' is internal and cannot be referenced from an '@inlinable' function}}
26
+
func inlinable()->SPIClass{ // expected-error {{class 'SPIClass' is '@_spi' and cannot be referenced from an '@inlinable' function}}
27
+
spiFunc() // expected-error {{global function 'spiFunc()' is '@_spi' and cannot be referenced from an '@inlinable' function}}
28
+
_ =SPIClass() // expected-error {{class 'SPIClass' is '@_spi' and cannot be referenced from an '@inlinable' function}}
29
29
}
30
30
31
31
@_spi(S)publicstructSPIStruct{} // expected-note 2 {{struct 'SPIStruct' is not '@usableFromInline' or public}}
32
32
33
33
@frozenpublicstructFrozenStruct{
34
-
@_spi(S)publicvarasdf=SPIStruct() // expected-error {{struct 'SPIStruct' is internal and cannot be referenced from a property initializer in a '@frozen' type}}
35
-
varasdf=SPIStruct() // expected-error {{struct 'SPIStruct' is internal and cannot be referenced from a property initializer in a '@frozen' type}}
34
+
@_spi(S)publicvarasdf=SPIStruct() // expected-error {{struct 'SPIStruct' is '@_spi' and cannot be referenced from a property initializer in a '@frozen' type}}
35
+
varasdf=SPIStruct() // expected-error {{struct 'SPIStruct' is '@_spi' and cannot be referenced from a property initializer in a '@frozen' type}}
@_spi(S)publicclassBadSubclass:InternalClass{} // expected-error{{class cannot be declared public because its superclass is internal}}
41
41
@_spi(S)publicclassOkSPISubclass:SPIClass{} // OK
42
-
publicclassBadPublicClass:SPIClass{} // expected-error {{class cannot be declared public because its superclass is internal}}
42
+
publicclassBadPublicClass:SPIClass{} // expected-error {{class cannot be declared public because its superclass is '@_spi'}}
43
43
@_spi(S)publicclassBadSPIClass:PrivateClass{} // expected-error {{class cannot be declared public because its superclass is private}}
44
44
45
45
@_spi(s)publicfunc genFunc<T:PrivateProtocol>(_ t:T){} // expected-error {{global function cannot be declared public because its generic parameter uses a private type}}
46
-
publicfunc genFuncBad<T:SPIProtocol>(_ t:T){} // expected-error {{global function cannot be declared public because its generic parameter uses an internal type}}
46
+
publicfunc genFuncBad<T:SPIProtocol>(_ t:T){} // expected-error {{global function cannot be declared public because its generic parameter uses an '@_spi' type}}
47
47
@_spi(S)publicfunc genFuncSPI<T:SPIProtocol>(_ t:T){} // OK
let _ =PublicStruct(alt_init:1) // expected-error {{argument passed to call that takes no arguments}}
32
-
ps.spiMethod() // expected-error {{'spiMethod' is inaccessible due to 'internal' protection level}} // TODO SPI specific diagnostics and suggest SPI to import
33
-
ps.spiVar ="write" // expected-error {{'spiVar' is inaccessible due to 'internal' protection level}}
34
-
print(ps.spiVar) // expected-error {{'spiVar' is inaccessible due to 'internal' protection level}}
32
+
ps.spiMethod() // expected-error {{'spiMethod' is inaccessible due to '@_spi' protection level}} // TODO SPI specific diagnostics and suggest SPI to import
33
+
ps.spiVar ="write" // expected-error {{'spiVar' is inaccessible due to '@_spi' protection level}}
34
+
print(ps.spiVar) // expected-error {{'spiVar' is inaccessible due to '@_spi' protection level}}
35
35
36
36
otherApiFunc() // expected-error {{use of unresolved identifier}}
0 commit comments