File tree Expand file tree Collapse file tree 4 files changed +13
-13
lines changed Expand file tree Collapse file tree 4 files changed +13
-13
lines changed Original file line number Diff line number Diff line change @@ -65,9 +65,9 @@ func testMemberAsyncRethrows(_ x: HasAsyncMembers) async {
65
65
func testAsyncIntiializers( ) async {
66
66
HasAsyncMembers( #^CHECK_initializers^#
67
67
// CHECK_initializers: Begin completions
68
- // CHECK_initializers-DAG: Decl[Constructor]/CurrNominal: ['('][')'][#HasAsyncMembers#]; name=
69
- // CHECK_initializers-DAG: Decl[Constructor]/CurrNominal: ['(']{#withAsync: Int#}[')'][#HasAsyncMembers#]; name=withAsync: Int
70
- // CHECK_initializers-DAG: Decl[Constructor]/CurrNominal: ['(']{#withAsyncThrows: Int#}[')'][' throws'][#HasAsyncMembers#]; name=withAsyncThrows: Int throws
71
- // CHECK_initializers-DAG: Decl[Constructor]/CurrNominal: ['(']{#withAsyncRethrows: () async throws -> Void##() async throws -> Void#}[')'][' rethrows'][#HasAsyncMembers#]; name=withAsyncRethrows: () async throws -> Void rethrows
68
+ // CHECK_initializers-DAG: Decl[Constructor]/CurrNominal: ['('][')'][' async'][ #HasAsyncMembers#]; name= async
69
+ // CHECK_initializers-DAG: Decl[Constructor]/CurrNominal: ['(']{#withAsync: Int#}[')'][' async'][ #HasAsyncMembers#]; name=withAsync: Int async
70
+ // CHECK_initializers-DAG: Decl[Constructor]/CurrNominal: ['(']{#withAsyncThrows: Int#}[')'][' async'][' throws'][#HasAsyncMembers#]; name=withAsyncThrows: Int async throws
71
+ // CHECK_initializers-DAG: Decl[Constructor]/CurrNominal: ['(']{#withAsyncRethrows: () async throws -> Void##() async throws -> Void#}[')'][' async'][' rethrows'][#HasAsyncMembers#]; name=withAsyncRethrows: () async throws -> Void async rethrows
72
72
// CHECK_initializers: End completions
73
73
}
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ class Presidio : GolfCourse {
36
36
set { yardsFromBackTees = newValue }
37
37
}
38
38
39
- override var holes : Int { // expected-error {{cannot override non-' async' property with ' async' property}}
39
+ override var holes : Int { // expected-error {{cannot override non-async property with async property}}
40
40
get async { 18 }
41
41
}
42
42
@@ -50,11 +50,11 @@ class Presidio : GolfCourse {
50
50
}
51
51
52
52
class PresidioBackNine : Presidio {
53
- override var par : Int { // expected-error{{cannot override non-'throws' property with 'throws' property}}
53
+ override var par : Int { // expected-error{{cannot override non-throwing property with throwing property}}
54
54
get throws { 36 } // attempts to put the 'throws' effect back
55
55
}
56
56
57
- override subscript( _ i : Int ) -> Int { // expected-error{{cannot override non-' async' subscript with ' async' subscript}}
57
+ override subscript( _ i : Int ) -> Int { // expected-error{{cannot override non-async subscript with async subscript}}
58
58
get async throws { 0 }
59
59
}
60
60
}
Original file line number Diff line number Diff line change @@ -71,10 +71,10 @@ class C1 : Super {
71
71
72
72
class C2 : Super {
73
73
override func tf( ) throws { }
74
- override func nf( ) throws { } // expected-error {{cannot override non-throwing method with throwing method}}
74
+ override func nf( ) throws { } // expected-error {{cannot override non-throwing instance method with throwing instance method}}
75
75
76
76
override func thf( _ f: ( ) throws -> ( ) ) throws { }
77
- override func nhf( _ f: ( ) throws -> ( ) ) throws { } // expected-error {{cannot override non-throwing method with throwing method}}
77
+ override func nhf( _ f: ( ) throws -> ( ) ) throws { } // expected-error {{cannot override non-throwing instance method with throwing instance method}}
78
78
override func rhf( _ f: ( ) throws -> ( ) ) throws { } // expected-error {{override of 'rethrows' method should also be 'rethrows'}}
79
79
}
80
80
@@ -83,7 +83,7 @@ class C3 : Super {
83
83
override func nf( ) { }
84
84
85
85
override func thf( _ f: ( ) throws -> ( ) ) rethrows { }
86
- override func nhf( _ f: ( ) throws -> ( ) ) rethrows { } // expected-error {{cannot override non-throwing method with throwing method}}
86
+ override func nhf( _ f: ( ) throws -> ( ) ) rethrows { } // expected-error {{cannot override non-throwing instance method with throwing instance method}}
87
87
override func rhf( _ f: ( ) throws -> ( ) ) rethrows { }
88
88
}
89
89
Original file line number Diff line number Diff line change @@ -314,12 +314,12 @@ protocol HammeredDulcimer {
314
314
}
315
315
316
316
protocol Santur : HammeredDulcimer {
317
- override subscript( _ note : Int ) -> Int { get throws } // expected-error{{cannot override non-'throws' subscript with 'throws' subscript}}
317
+ override subscript( _ note : Int ) -> Int { get throws } // expected-error{{cannot override non-throwing subscript with throwing subscript}}
318
318
override var bridges : Int { get throws }
319
319
}
320
320
321
321
protocol Santoor : Santur {
322
- override var bridges : Int { get async throws } // expected-error{{cannot override non-' async' property with ' async' property}}
322
+ override var bridges : Int { get async throws } // expected-error{{cannot override non-async property with async property}}
323
323
}
324
324
325
325
protocol Yangqin : HammeredDulcimer {
@@ -328,5 +328,5 @@ protocol Yangqin : HammeredDulcimer {
328
328
329
329
protocol Hackbrett : HammeredDulcimer {
330
330
override var bridges : Int { get } // no effects are OK
331
- override subscript( _ note : Int ) -> Int { get async throws } // expected-error {{cannot override non-' async' subscript with ' async' subscript}}
331
+ override subscript( _ note : Int ) -> Int { get async throws } // expected-error {{cannot override non-async subscript with async subscript}}
332
332
}
You can’t perform that action at this time.
0 commit comments