File tree Expand file tree Collapse file tree 2 files changed +51
-0
lines changed Expand file tree Collapse file tree 2 files changed +51
-0
lines changed Original file line number Diff line number Diff line change
1
+ // RUN: %target-swift-frontend -typecheck -verify -swift-version 3 %s
2
+
3
+ protocol Operator {
4
+ func + ( lhs: Self , rhs: Self ) -> Self // expected-warning {{operator '+' declared in protocol must be 'static'}}
5
+ }
6
+
7
+ func foo( x: Int ... , _: String ) { } // expected-warning {{a parameter following a variadic parameter requires a label}}
8
+
9
+ protocol P1 { }
10
+ protocol P2 { }
11
+
12
+ let x : protocol < > // expected-warning {{'protocol<>' syntax is deprecated; use 'Any' instead}}
13
+ let y : protocol < P1 > // expected-warning {{'protocol<...>' composition syntax is deprecated and not needed here}}}
14
+ let z : protocol < P1 , P2 > // expected-warning {{'protocol<...>' composition syntax is deprecated; join the protocols using '&'}}
15
+
16
+ func bar( f: @noescape ( ) -> ( ) ) { } // expected-warning {{@noescape is the default and is deprecated}}
17
+
18
+ func baz( f: @autoclosure ( escaping ) ( ) -> ( ) ) { } // expected-warning {{@autoclosure(escaping) is deprecated; use @autoclosure @escaping instead}}
19
+
20
+ prefix operator +++ { } // expected-warning {{operator should no longer be declared with body}}
21
+ postfix operator +++ { } // expected-warning {{operator should no longer be declared with body}}
22
+ infix operator +++ { } // expected-warning {{operator should no longer be declared with body}}
23
+ infix operator +++* { // expected-warning {{operator should no longer be declared with body; use a precedence group instead}}
24
+ associativity right
25
+ }
26
+
Original file line number Diff line number Diff line change
1
+ // RUN: %target-swift-frontend -typecheck -verify -swift-version 4 %s
2
+
3
+ protocol Operator {
4
+ func + ( lhs: Self , rhs: Self ) -> Self // expected-error {{operator '+' declared in protocol must be 'static'}}
5
+ }
6
+
7
+ func foo( x: Int ... , _: String ) { } // expected-error {{a parameter following a variadic parameter requires a label}}
8
+
9
+ protocol P1 { }
10
+ protocol P2 { }
11
+
12
+ let x : protocol < > // expected-error {{'protocol<>' syntax has been removed; use 'Any' instead}}
13
+ let y : protocol < P1 > // expected-error {{'protocol<...>' composition syntax has been removed and is not needed here}}}
14
+ let z : protocol < P1 , P2 > // expected-error {{'protocol<...>' composition syntax has been removed; join the protocols using '&'}}
15
+
16
+ func bar( f: @noescape ( ) -> ( ) ) { } // expected-error {{@noescape is the default and has been removed}}
17
+
18
+ func baz( f: @autoclosure ( escaping ) ( ) -> ( ) ) { } // expected-error {{@autoclosure(escaping) has been removed; use @autoclosure @escaping instead}}
19
+
20
+ prefix operator +++ { } // expected-error {{operator should no longer be declared with body}}
21
+ postfix operator +++ { } // expected-error {{operator should no longer be declared with body}}
22
+ infix operator +++ { } // expected-error {{operator should no longer be declared with body}}
23
+ infix operator +++* { // expected-error {{operator should no longer be declared with body; use a precedence group instead}}
24
+ associativity right
25
+ }
You can’t perform that action at this time.
0 commit comments