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
Check access control for the generic requirements of typealiases.
Also oops. This one was a little more involved because the requirements
on a generic typealias don't always carry a Type anymore; sometimes all
you have is the TypeRepr. That should still be okay in practice as long
as we don't start doing that for var/let, which can have part of a type
be inferred but not all of it.
Copy file name to clipboardExpand all lines: test/Sema/accessibility.swift
+3Lines changed: 3 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -876,3 +876,6 @@ public struct TestGenericSubscripts {
876
876
public subscript<T:PrivateProto>(_:T)->Int{return0} // expected-warning {{subscript should not be declared public because its generic parameter uses a private type}} {{none}}
877
877
public subscript<T>(where _:T)->Intwhere T:PrivateProto{return0} // expected-warning {{subscript should not be declared public because its generic requirement uses a private type}} {{none}}
878
878
}
879
+
880
+
publictypealiasTestGenericAlias<T:PrivateProto>=T // expected-warning {{type alias should not be declared public because its generic parameter uses a private type}}
881
+
publictypealiasTestGenericAliasWhereClause<T>=T where T: PrivateProto // expected-warning {{type alias should not be declared public because its generic requirement uses a private type}}
Copy file name to clipboardExpand all lines: test/attr/attr_usableFromInline.swift
+3Lines changed: 3 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -152,3 +152,6 @@ public struct TestGenericSubscripts {
152
152
@usableFromInline subscript<T:InternalProtocol>(_:T)->Int{return0} // expected-warning {{type referenced from a generic parameter of a '@usableFromInline' subscript should be '@usableFromInline' or public}}
153
153
@usableFromInline subscript<T>(where _:T)->Intwhere T:InternalProtocol{return0} // expected-warning {{type referenced from a generic requirement of a '@usableFromInline' subscript should be '@usableFromInline' or public}}
154
154
}
155
+
156
+
@usableFromInlinetypealiasTestGenericAlias<T:InternalProtocol>=T // expected-warning {{type referenced from a generic parameter of a '@usableFromInline' type alias should be '@usableFromInline' or public}}
157
+
@usableFromInlinetypealiasTestGenericAliasWhereClause<T>=T where T: InternalProtocol // expected-warning {{type referenced from a generic requirement of a '@usableFromInline' type alias should be '@usableFromInline' or public}}
0 commit comments