@@ -9,32 +9,31 @@ protocol P<T> {
9
9
associatedtype T
10
10
}
11
11
12
- extension Never : P { typealias T = Never }
12
+ struct S : P {
13
+ typealias T = Self
14
+ }
13
15
14
16
// I do not like them written clear
15
- func test( ) -> any P < some P > { fatalError ( ) } // expected-error {{'some' types cannot be used in constraints on existential types}}
16
-
17
- // I do not like them nested here
18
- func test( ) -> any P < [ some P ] > { fatalError ( ) } // expected-error {{'some' types cannot be used in constraints on existential types}}
17
+ func test( ) -> any P < some P > { S ( ) } // expected-error {{'some' types cannot be used in constraints on existential types}}
19
18
20
19
// I do not like them under questions
21
- func test( ) -> any P < ( some P ) ? ? > { fatalError ( ) } // expected-error {{'some' types cannot be used in constraints on existential types}}
20
+ func test( ) -> any P < ( some P ) ? ? > { S ( ) } // expected-error {{'some' types cannot be used in constraints on existential types}}
22
21
23
22
// I do not like meta-type intentions
24
- func test( ) -> ( any P < some P > ) . Type { fatalError ( ) } // expected-error {{'some' types cannot be used in constraints on existential types}}
23
+ func test( ) -> ( any P < some P > ) . Type { S ( ) } // expected-error {{'some' types cannot be used in constraints on existential types}}
25
24
26
25
// I do not like them (meta)static-ly
27
- func test( ) -> any P < some P > . Type { fatalError ( ) } // expected-error {{'some' types cannot be used in constraints on existential types}}
26
+ func test( ) -> any P < some P > . Type { S ( ) } // expected-error {{'some' types cannot be used in constraints on existential types}}
28
27
29
28
// I do not like them tupled-three
30
- func test( ) -> ( Int , any P < some P > , Int ) { fatalError ( ) } // expected-error {{'some' types cannot be used in constraints on existential types}}
29
+ func test( ) -> ( Int , any P < some P > , Int ) { S ( ) } // expected-error {{'some' types cannot be used in constraints on existential types}}
31
30
32
31
// I do not like them in generics
33
32
struct Wrapper < T> { }
34
- func test( ) -> any P < Wrapper < some P > > { fatalError ( ) } // expected-error {{'some' types cannot be used in constraints on existential types}}
33
+ func test( ) -> any P < Wrapper < some P > > { S ( ) } // expected-error {{'some' types cannot be used in constraints on existential types}}
35
34
36
35
// Your attempts to nest them put me in hysterics.
37
- func test( _ x: any P < some P > ) { } // expected-error {{'some' types cannot be used in constraints on existential types}}
36
+ func test( _ x: any P < some P > ) { } // expected-error {{'some' types cannot be used in constraints on existential types}}
38
37
39
38
// No, I do not like nested some type params,
40
39
// I do not like them Σam-i-am
0 commit comments