Commit ad0e180
Fix false positive for Final local scope variable in Protocol (#17308)
This PR fixes and closes #17281 ,which reported a false positive when
using Final within the local function scope of a protocol method.
With these changes:
- Local variables within protocol methods can be marked as Final.
- Protocol members still cannot be marked as Final
Modified ``semanal.py`` file and added a unit test in
``test-data/unit/check.final.test``
---------
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Stanislav Terliakov1 parent 16d5aaf commit ad0e180
2 files changed
+46
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3505 | 3505 | | |
3506 | 3506 | | |
3507 | 3507 | | |
3508 | | - | |
| 3508 | + | |
| 3509 | + | |
3509 | 3510 | | |
3510 | 3511 | | |
3511 | 3512 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
301 | 301 | | |
302 | 302 | | |
303 | 303 | | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
304 | 348 | | |
305 | 349 | | |
306 | 350 | | |
| |||
0 commit comments