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
SE-0025: Parsing and basic completion for 'fileprivate'. (#3391)
Right now 'fileprivate' is parsed as an alias for 'private' (or
perhaps vice versa, since the semantics of 'private' haven't changed
yet). This allows us to migrate code to 'fileprivate' without waiting
for the full implementation.
privatefunc publicReq(){} // expected-error {{method 'publicReq()' must be declared public because it matches a requirement in public protocol 'PublicProto'}} {{3-10=public}}
19
23
privatefunc internalReq(){} // expected-error {{method 'internalReq()' must be declared internal because it matches a requirement in internal protocol 'InternalProto'}} {{3-10=internal}}
privatefunc publicReq(){} // expected-error {{method 'publicReq()' must be as accessible as its enclosing type because it matches a requirement in protocol 'PublicProto'}} {{3-10=internal}}
28
33
privatefunc internalReq(){} // expected-error {{method 'internalReq()' must be declared internal because it matches a requirement in internal protocol 'InternalProto'}} {{3-10=internal}}
34
+
privatefunc filePrivateReq(){}
29
35
privatefunc privateReq(){}
30
36
31
37
publicvarpublicVar=0 // expected-warning {{declaring a public var for an internal struct}} {{3-9=internal}}
publicfunc extMemberInternal(){} // expected-warning {{declaring a public instance method in an internal extension}} {{3-9=internal}}
85
130
privatefunc extImplInternal(){}
86
131
}
132
+
fileprivateextensionPrivateStruct{
133
+
publicfunc extMemberFilePrivate(){} // expected-warning {{declaring a public instance method in a private extension}} {{3-9=private}}
134
+
privatefunc extImplFilePrivate(){}
135
+
}
87
136
privateextensionPrivateStruct{
88
137
publicfunc extMemberPrivate(){} // expected-warning {{declaring a public instance method in a private extension}} {{3-9=private}}
89
138
privatefunc extImplPrivate(){}
@@ -152,12 +201,14 @@ internal class InternalSubPrivateSet: Base {
152
201
153
202
publictypealiasPublicTA1=PublicStruct
154
203
publictypealiasPublicTA2=InternalStruct // expected-error {{type alias cannot be declared public because its underlying type uses an internal type}}
155
-
publictypealiasPublicTA3=PrivateStruct // expected-error {{type alias cannot be declared public because its underlying type uses a private type}}
204
+
publictypealiasPublicTA3=FilePrivateStruct // expected-error {{type alias cannot be declared public because its underlying type uses a private type}}
205
+
publictypealiasPublicTA4=PrivateStruct // expected-error {{type alias cannot be declared public because its underlying type uses a private type}}
156
206
157
207
// expected-note@+1 {{type declared here}}
158
208
internaltypealiasInternalTA1=PublicStruct
159
209
internaltypealiasInternalTA2=InternalStruct
160
-
internaltypealiasInternalTA3=PrivateStruct // expected-error {{type alias cannot be declared internal because its underlying type uses a private type}}
210
+
internaltypealiasInternalTA3=FilePrivateStruct // expected-error {{type alias cannot be declared internal because its underlying type uses a private type}}
211
+
internaltypealiasInternalTA4=PrivateStruct // expected-error {{type alias cannot be declared internal because its underlying type uses a private type}}
161
212
162
213
publictypealiasPublicFromInternal=InternalTA1 // expected-error {{type alias cannot be declared public because its underlying type uses an internal type}}
0 commit comments