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
Copy file name to clipboardexpand all lines: test/Parse/enum.swift
+9-8
Original file line number
Diff line number
Diff line change
@@ -553,42 +553,43 @@ enum SE0155 {
553
553
// expected-note@-2 {{did you mean to explicitly add a 'Void' associated value?}} {{18-18=Void}}
554
554
}
555
555
556
-
// SR-11261
557
-
enumSR11261{
556
+
// https://github.com/apple/swift/issues/53662
557
+
558
+
enumE_53662{
558
559
case identifier
559
560
case operator // expected-error {{keyword 'operator' cannot be used as an identifier here}} expected-note {{if this name is unavoidable, use backticks to escape it}} {{8-16=`operator`}}
560
561
case identifier2
561
562
}
562
563
563
-
enumSR11261_var{
564
+
enumE_53662_var{
564
565
case identifier
565
566
case var // expected-error {{keyword 'var' cannot be used as an identifier here}} expected-note {{if this name is unavoidable, use backticks to escape it}} {{8-11=`var`}}
566
567
case identifier2
567
568
}
568
569
569
-
enumSR11261_underscore{
570
+
enumE_53662_underscore{
570
571
case identifier
571
572
case _ // expected-error {{keyword '_' cannot be used as an identifier here}} expected-note {{if this name is unavoidable, use backticks to escape it}} {{8-9=`_`}}
572
573
case identifier2
573
574
}
574
575
575
-
enumSR11261_Comma{
576
+
enumE_53662_Comma{
576
577
case a, b, c, func, d // expected-error {{keyword 'func' cannot be used as an identifier here}} expected-note {{if this name is unavoidable, use backticks to escape it}} {{17-21=`func`}}
577
578
}
578
579
579
-
enumSR11261_Newline{
580
+
enumE_53662_Newline{
580
581
case identifier1
581
582
case identifier2
582
583
case
583
584
case identifier // expected-error {{keyword 'case' cannot be used as an identifier here}} expected-note {{if this name is unavoidable, use backticks to escape it}} {{3-7=`case`}}
584
585
}
585
586
586
-
enumSR11261_Newline2{
587
+
enumE_53662_Newline2{
587
588
case
588
589
func foo(){} // expected-error {{keyword 'func' cannot be used as an identifier here}} expected-note {{if this name is unavoidable, use backticks to escape it}} {{3-7=`func`}}
589
590
}
590
591
591
-
enumSR11261_PatternMatching{
592
+
enumE_53662_PatternMatching{
592
593
case let .foo(x,y): // expected-error {{'case' label can only appear inside a 'switch' statement}}
Copy file name to clipboardexpand all lines: test/Parse/errors.swift
+2-1
Original file line number
Diff line number
Diff line change
@@ -155,7 +155,8 @@ func fixitThrow2() throws {
155
155
156
156
letfn:()-> throws Void // expected-error{{'throws' may only occur before '->'}} {{12-12=throws }} {{15-22=}}
157
157
158
-
// SR-11574
158
+
// https://github.com/apple/swift/issues/53979
159
+
159
160
func fixitTry0<T>(a:T) try where T:ExpressibleByStringLiteral{} // expected-error{{expected throwing specifier; did you mean 'throws'?}} {{25-28=throws}}
160
161
func fixitTry1<T>(a:T) try {} // expected-error{{expected throwing specifier; did you mean 'throws'?}} {{25-28=throws}}
161
162
func fixitTry2() try {} // expected-error{{expected throwing specifier; did you mean 'throws'?}} {{18-21=throws}}
func SR979a(a :inoutinoutInt){} // expected-error {{parameter must not have multiple '__owned', 'inout', or '__shared' specifiers}} {{17-23=}}
91
-
func SR979b(inout inout b:Int){} // expected-error {{inout' before a parameter name is not allowed, place it before the parameter type instead}} {{13-18=}} {{28-28=inout }}
92
-
// expected-error@-1 {{parameter must not have multiple '__owned', 'inout', or '__shared' specifiers}} {{19-25=}}
93
-
func SR979d(let let a:Int){} // expected-warning {{'let' in this position is interpreted as an argument label}} {{13-16=`let`}}
func f1_43591(a :inoutinoutInt){} // expected-error {{parameter must not have multiple '__owned', 'inout', or '__shared' specifiers}} {{19-25=}}
98
+
func f2_43591(inout inout b:Int){} // expected-error {{inout' before a parameter name is not allowed, place it before the parameter type instead}} {{15-20=}} {{30-30=inout }}
99
+
// expected-error@-1 {{parameter must not have multiple '__owned', 'inout', or '__shared' specifiers}} {{21-27=}}
100
+
func f3_43591(let let a:Int){} // expected-warning {{'let' in this position is interpreted as an argument label}} {{15-18=`let`}}
// expected-error @-2 {{expected ':' following argument label and parameter name}}
96
-
// expected-warning @-3 {{extraneous duplicate parameter name; 'let' already has an argument label}} {{13-17=}}
97
-
funcSR979e(inout x:inoutString){} // expected-error {{parameter must not have multiple '__owned', 'inout', or '__shared' specifiers}} {{13-18=}}
98
-
funcSR979g(inout i:inoutInt){} // expected-error {{parameter must not have multiple '__owned', 'inout', or '__shared' specifiers}} {{13-18=}}
103
+
// expected-warning @-3 {{extraneous duplicate parameter name; 'let' already has an argument label}} {{15-19=}}
104
+
funcf4_43591(inout x:inoutString){} // expected-error {{parameter must not have multiple '__owned', 'inout', or '__shared' specifiers}} {{15-20=}}
105
+
funcf5_43591(inout i:inoutInt){} // expected-error {{parameter must not have multiple '__owned', 'inout', or '__shared' specifiers}} {{15-20=}}
99
106
100
107
funcrepeat(){}
101
108
// expected-error @-1 {{keyword 'repeat' cannot be used as an identifier here}}
@@ -136,15 +143,17 @@ let x: () = ()
136
143
!(x) // expected-error {{cannot convert value of type '()' to expected argument type 'Bool'}}
137
144
!x // expected-error {{cannot convert value of type '()' to expected argument type 'Bool'}}
138
145
139
-
func sr8202_foo(@NSApplicationMain x:Int){} // expected-error {{@NSApplicationMain may only be used on 'class' declarations}}
140
-
func sr8202_bar(@available(iOS, deprecated:0) x:Int){} // expected-error {{'@available' attribute cannot be applied to this declaration}}
141
-
func sr8202_baz(@discardableResult x:Int){} // expected-error {{'@discardableResult' attribute cannot be applied to this declaration}}
142
-
func sr8202_qux(@objcMembers x:String){} // expected-error {{@objcMembers may only be used on 'class' declarations}}
143
-
func sr8202_quux(@weak x:String){} // expected-error {{'weak' is a declaration modifier, not an attribute}} expected-error {{'weak' may only be used on 'var' declarations}}
146
+
// https://github.com/apple/swift/issues/50734
147
+
148
+
func f1_50734(@NSApplicationMain x:Int){} // expected-error {{@NSApplicationMain may only be used on 'class' declarations}}
149
+
func f2_50734(@available(iOS, deprecated:0) x:Int){} // expected-error {{'@available' attribute cannot be applied to this declaration}}
150
+
func f3_50734(@discardableResult x:Int){} // expected-error {{'@discardableResult' attribute cannot be applied to this declaration}}
151
+
func f4_50734(@objcMembers x:String){} // expected-error {{@objcMembers may only be used on 'class' declarations}}
152
+
func f5_50734(@weak x:String){} // expected-error {{'weak' is a declaration modifier, not an attribute}} expected-error {{'weak' may only be used on 'var' declarations}}
144
153
145
-
classsr8202_cls<@NSApplicationMain T:AnyObject>{} // expected-error {{@NSApplicationMain may only be used on 'class' declarations}}
146
-
funcsr8202_func<@discardableResult T>(x:T){} // expected-error {{'@discardableResult' attribute cannot be applied to this declaration}}
147
-
enumsr8202_enum<@indirect T>{} // expected-error {{'indirect' is a declaration modifier, not an attribute}} expected-error {{'indirect' modifier cannot be applied to this declaration}}
154
+
classC_50734<@NSApplicationMain T:AnyObject>{} // expected-error {{@NSApplicationMain may only be used on 'class' declarations}}
155
+
funcf6_50734<@discardableResult T>(x:T){} // expected-error {{'@discardableResult' attribute cannot be applied to this declaration}}
156
+
enumE_50734<@indirect T>{} // expected-error {{'indirect' is a declaration modifier, not an attribute}} expected-error {{'indirect' modifier cannot be applied to this declaration}}
148
157
protocol P {
149
158
@available(swift, introduced:4.2) associatedtype Assoc // expected-error {{'@available' attribute cannot be applied to this declaration}}
0 commit comments