Commit 5abe5a3
Based on [the lastest thinking on
#4672](#4672 (comment))
, require a full syntactic match for impl redeclaration, instead of
excluding the `where` restriction. This means no updates to the impl
witness on redeclaration, and no diagnostics that those updates are
consistent.
Not included in this PR, but will need to be done in the future:
* Support for assigning values to associated constants in the body of
the impl definition. This will require moving the checking that
non-function associated constants are set from the definition start to
definition end.
* Identify semantic redeclarations that are not syntactic matches to
give a failed redeclaration diagnostic. This should be done once we are
already identifying impl declarations with the same type structure in
order to require they be identified in an impl_priority/match_first
block.
* Merging of the functions in `check/impl.cpp` that are now always
called together.
Also add some test coverage of `where` parsing I developed in PR I've
now abandoned because of this new simplification of the impl
redeclaration semantics.
---------
Co-authored-by: Josh L <[email protected]>
Co-authored-by: Jon Ross-Perkins <[email protected]>
1 parent 0d0e202 commit 5abe5a3
File tree
8 files changed
+393
-339
lines changed- toolchain
- check
- testdata/impl/no_prelude
- diagnostics
- parse/testdata/where_expr
8 files changed
+393
-339
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
217 | | - | |
218 | 217 | | |
219 | 218 | | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | 219 | | |
224 | 220 | | |
225 | 221 | | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | 222 | | |
252 | 223 | | |
253 | 224 | | |
| |||
315 | 286 | | |
316 | 287 | | |
317 | 288 | | |
318 | | - | |
319 | | - | |
320 | | - | |
321 | 289 | | |
322 | 290 | | |
323 | 291 | | |
| |||
375 | 343 | | |
376 | 344 | | |
377 | 345 | | |
| 346 | + | |
| 347 | + | |
378 | 348 | | |
379 | 349 | | |
380 | 350 | | |
| |||
392 | 362 | | |
393 | 363 | | |
394 | 364 | | |
395 | | - | |
396 | | - | |
| 365 | + | |
| 366 | + | |
397 | 367 | | |
398 | 368 | | |
399 | 369 | | |
400 | 370 | | |
401 | 371 | | |
402 | | - | |
403 | | - | |
404 | 372 | | |
405 | 373 | | |
406 | 374 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | 35 | | |
46 | 36 | | |
47 | 37 | | |
| |||
88 | 78 | | |
89 | 79 | | |
90 | 80 | | |
| 81 | + | |
91 | 82 | | |
92 | 83 | | |
93 | 84 | | |
| |||
159 | 150 | | |
160 | 151 | | |
161 | 152 | | |
| 153 | + | |
162 | 154 | | |
163 | 155 | | |
164 | | - | |
165 | | - | |
166 | | - | |
| 156 | + | |
167 | 157 | | |
168 | 158 | | |
169 | 159 | | |
| |||
229 | 219 | | |
230 | 220 | | |
231 | 221 | | |
232 | | - | |
| 222 | + | |
233 | 223 | | |
234 | 224 | | |
235 | 225 | | |
236 | 226 | | |
237 | 227 | | |
238 | 228 | | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | 229 | | |
243 | 230 | | |
244 | 231 | | |
| |||
264 | 251 | | |
265 | 252 | | |
266 | 253 | | |
| 254 | + | |
| 255 | + | |
267 | 256 | | |
268 | 257 | | |
269 | 258 | | |
| |||
276 | 265 | | |
277 | 266 | | |
278 | 267 | | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | | - | |
311 | | - | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
312 | 271 | | |
313 | 272 | | |
314 | 273 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
21 | | - | |
| 19 | + | |
22 | 20 | | |
23 | 21 | | |
24 | 22 | | |
| |||
0 commit comments