File tree Expand file tree Collapse file tree 3 files changed +27
-6
lines changed Expand file tree Collapse file tree 3 files changed +27
-6
lines changed Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ func customHashable() {
61
61
enum InvalidCustomHashable {
62
62
case A, B
63
63
64
- var hashValue : String { return " " }
64
+ var hashValue : String { return " " } // expected-error {{invalid redeclaration of synthesized witness for protocol requirement 'hashValue'}}
65
65
}
66
66
func == ( x: InvalidCustomHashable , y: InvalidCustomHashable ) -> String {
67
67
return " "
@@ -369,7 +369,6 @@ func canEatHotChip(_ birthyear:Birthyear) -> Bool {
369
369
return birthyear > . nineties( 3 )
370
370
}
371
371
// FIXME: Remove -verify-ignore-unknown.
372
- // <unknown>:0: error: unexpected error produced: invalid redeclaration of 'hashValue'
373
372
// <unknown>:0: error: unexpected note produced: candidate has non-matching type '(Foo, Foo) -> Bool'
374
373
// <unknown>:0: error: unexpected note produced: candidate has non-matching type '<T> (Generic<T>, Generic<T>) -> Bool'
375
374
// <unknown>:0: error: unexpected note produced: candidate has non-matching type '(InvalidCustomHashable, InvalidCustomHashable) -> Bool'
Original file line number Diff line number Diff line change @@ -31,19 +31,24 @@ let _ = SimpleStruct.encode(to:)
31
31
let _ = SimpleStruct . CodingKeys. self // expected-error {{'CodingKeys' is inaccessible due to 'private' protection level}}
32
32
33
33
// rdar://problem/59655704
34
- struct SR_12248_1 : Codable { // expected-error {{type 'SR_12248_1' does not conform to protocol 'Encodable'}}
34
+ struct SR_12248_1 : Codable {
35
+ // expected-error@-1 {{type 'SR_12248_1' does not conform to protocol 'Encodable'}}
36
+ // expected-error@-2 {{invalid redeclaration of synthesized enum case 'x'}}
37
+
35
38
var x : Int // expected-note {{'x' previously declared here}}
36
39
var x : Int // expected-error {{invalid redeclaration of 'x'}}
37
40
// expected-note@-1 {{cannot automatically synthesize 'Encodable' because '<<error type>>' does not conform to 'Encodable'}}
38
41
// expected-note@-2 {{cannot automatically synthesize 'Encodable' because '<<error type>>' does not conform to 'Encodable'}}
39
42
}
40
43
41
- struct SR_12248_2 : Decodable {
44
+ struct SR_12248_2 : Decodable {
45
+ // expected-error@-1 {{invalid redeclaration of synthesized enum case 'x'}}
42
46
var x : Int // expected-note {{'x' previously declared here}}
43
47
var x : Int // expected-error {{invalid redeclaration of 'x'}}
44
48
}
45
49
46
- struct SR_12248_3 : Encodable {
50
+ struct SR_12248_3 : Encodable {
51
+ // expected-error@-1 {{invalid redeclaration of synthesized enum case 'x'}}
47
52
var x : Int // expected-note {{'x' previously declared here}}
48
53
var x : Int // expected-error {{invalid redeclaration of 'x'}}
49
54
}
Original file line number Diff line number Diff line change @@ -849,13 +849,30 @@ struct WrapperWithProjectedValue<T> {
849
849
var projectedValue : T { return wrappedValue }
850
850
}
851
851
852
- class TestInvalidRedeclaration {
852
+ class TestInvalidRedeclaration1 {
853
+ // expected-error@-1 {{invalid redeclaration of synthesized property '_i'}}
854
+ // expected-error@-2 {{invalid redeclaration of synthesized property '$i'}}
855
+
853
856
@WrapperWithProjectedValue var i = 17
854
857
// expected-note@-1 {{'i' previously declared here}}
858
+ // expected-note@-2 {{'$i' synthesized for property wrapper projected value}}
859
+ // expected-note@-3 {{'_i' synthesized for property wrapper backing storage}}
860
+
855
861
@WrapperWithProjectedValue var i = 39
856
862
// expected-error@-1 {{invalid redeclaration of 'i'}}
857
863
}
858
864
865
+ // SR-12839
866
+ struct TestInvalidRedeclaration2 {
867
+ var _foo1 = 123 // expected-error {{invalid redeclaration of synthesized property '_foo1'}}
868
+ @WrapperWithInitialValue var foo1 = 123 // expected-note {{'_foo1' synthesized for property wrapper backing storage}}
869
+ }
870
+
871
+ struct TestInvalidRedeclaration3 {
872
+ @WrapperWithInitialValue var foo1 = 123 // expected-note {{'_foo1' synthesized for property wrapper backing storage}}
873
+ var _foo1 = 123 // expected-error {{invalid redeclaration of synthesized property '_foo1'}}
874
+ }
875
+
859
876
// ---------------------------------------------------------------------------
860
877
// Closures in initializers
861
878
// ---------------------------------------------------------------------------
You can’t perform that action at this time.
0 commit comments