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
We would like to leave room in the language for `some` types in existential
constraints a la `any P<some Q>` to resolve as a part of the requirement
signature of a future generalized existential type. To that end, usages of
`some` types nested anywhere in the arguments of an existential will fail to
resolve.
rdar://92758884
func test()->anyP<someP>{fatalError()} // expected-error {{'some' types cannot be used in constraints on existential types}} expected-error {{generic parameter}}
13
+
// I do not like them nested here
14
+
func test()->anyP<[someP]>{fatalError()} // expected-error {{'some' types cannot be used in constraints on existential types}} expected-error {{generic parameter}}
15
+
// I do not like them under questions
16
+
func test()->anyP<(someP)??>{fatalError()} // expected-error {{'some' types cannot be used in constraints on existential types}} expected-error {{generic parameter}}
17
+
// I do not like meta-type intentions
18
+
func test()->(anyP<someP>).Type {fatalError()} // expected-error {{'some' types cannot be used in constraints on existential types}} expected-error {{generic parameter}}
19
+
// I do not like them (meta)static-ly
20
+
func test()->anyP<someP>.Type{fatalError()} // expected-error {{'some' types cannot be used in constraints on existential types}} expected-error {{generic parameter}}
21
+
// I do not like them tupled-three
22
+
func test()->(Int,anyP<someP>,Int){fatalError()} // expected-error {{'some' types cannot be used in constraints on existential types}} expected-error {{generic parameter}}
23
+
// I do not like them in generics
24
+
structWrapper<T>{}
25
+
func test()->anyP<Wrapper<someP>>{fatalError()} // expected-error {{'some' types cannot be used in constraints on existential types}} expected-error {{generic parameter}}
26
+
// Your attempts to nest them put me in hysterics.
27
+
func test(_ x:anyP<someP>){} // expected-error {{'some' types cannot be used in constraints on existential types}}
0 commit comments