@@ -174,12 +174,12 @@ final class EffectfulPropertiesTests: XCTestCase {
174174 assertParse (
175175 """
176176 var bad1 : Int {
177- get rethrows { 0 }
177+ get 1️⃣rethrows { 0 }
178178 set rethrows { }
179179 }
180180 """ ,
181181 diagnostics: [
182- // TODO: Old parser expected error on line 2: only function declarations may be marked 'rethrows'; did you mean 'throws'?
182+ DiagnosticSpec ( message : " only function declarations may be marked 'rethrows'; did you mean 'throws'? " )
183183 ]
184184 )
185185 }
@@ -244,7 +244,9 @@ final class EffectfulPropertiesTests: XCTestCase {
244244 }
245245 """ ,
246246 diagnostics: [
247- DiagnosticSpec ( message: " unexpected code 'bogus' before effect specifiers " )
247+ // TODO: Should produce two diagnostics?
248+ //DiagnosticSpec(message: "unexpected code 'bogus' before effect specifiers"),
249+ DiagnosticSpec ( message: " only function declarations may be marked 'rethrows'; did you mean 'throws'? " )
248250 ]
249251 )
250252 }
@@ -253,11 +255,12 @@ final class EffectfulPropertiesTests: XCTestCase {
253255 assertParse (
254256 """
255257 var bad6 : Int {
256- get rethrows 1️⃣ -> Int { 0 }
258+ get 1️⃣rethrows 2️⃣ -> Int { 0 }
257259 }
258260 """ ,
259261 diagnostics: [
260- DiagnosticSpec ( message: " unexpected code '-> Int' in accessor " )
262+ DiagnosticSpec ( locationMarker: " 1️⃣ " , message: " only function declarations may be marked 'rethrows'; did you mean 'throws'? " ) ,
263+ DiagnosticSpec ( locationMarker: " 2️⃣ " , message: " unexpected code '-> Int' in accessor " )
261264 ]
262265 )
263266 }
@@ -290,20 +293,23 @@ final class EffectfulPropertiesTests: XCTestCase {
290293 }
291294
292295 func testEffectfulProperties20( ) {
296+ // TODO: diagnostics at 1️⃣ should be valid
293297 assertParse (
294298 """
295299 protocol BadP {
296- var prop2 : Int { get 1️⃣bogus rethrows set }
297- var prop3 : Int { get rethrows 2️⃣bogus set }
298- var prop4 : Int { get reasync 3️⃣bogus set }
299- var prop5 : Int { get throws 4️⃣async }
300+ var prop2 : Int { get 2️⃣bogus rethrows set }
301+ var prop3 : Int { get 3️⃣rethrows 4️⃣bogus set }
302+ var prop4 : Int { get reasync 5️⃣bogus set }
303+ var prop5 : Int { get throws 6️⃣async }
300304 }
301305 """ ,
302306 diagnostics: [
303- DiagnosticSpec ( locationMarker: " 1️⃣ " , message: " unexpected code 'bogus' before effect specifiers " ) ,
304- DiagnosticSpec ( locationMarker: " 2️⃣ " , message: " unexpected code 'bogus set' in variable " ) ,
305- DiagnosticSpec ( locationMarker: " 3️⃣ " , message: " unexpected code 'bogus set' in variable " ) ,
306- DiagnosticSpec ( locationMarker: " 4️⃣ " , message: " 'async' must precede 'throws' " ) ,
307+ // DiagnosticSpec(locationMarker: "1️⃣", message: "unexpected code 'bogus' before effect specifiers"),
308+ DiagnosticSpec ( locationMarker: " 2️⃣ " , message: " only function declarations may be marked 'rethrows'; did you mean 'throws'? " ) ,
309+ DiagnosticSpec ( locationMarker: " 3️⃣ " , message: " only function declarations may be marked 'rethrows'; did you mean 'throws'? " ) ,
310+ DiagnosticSpec ( locationMarker: " 4️⃣ " , message: " unexpected code 'bogus set' in variable " ) ,
311+ DiagnosticSpec ( locationMarker: " 5️⃣ " , message: " unexpected code 'bogus set' in variable " ) ,
312+ DiagnosticSpec ( locationMarker: " 6️⃣ " , message: " 'async' must precede 'throws' " ) ,
307313 ]
308314 )
309315 }
0 commit comments