Commit 3199847
[CFE] Don't issue bogus NNBD Strong error as package sets a language version
Before this CL, if one compiled a script as strong nnbd (with nnbd
enabled), where the script was marked as as a version where nnbd is enabled,
but where the script lived in a package with a version that was too low
one would get an error.
The reason is that the language version is set twice:
First when the library is created (but the file isn't read yet). This sets
the version from the package. Here an error was issued.
The second time is when the file is read and the file-version-marker is
parsed (e.g. @Dart = 2.9).
The error should only be given if - once the final verison has been set
(i.e. after parsing the file) - the version is "wrong".
To make matters worse the (bogus) error given even points to the files
first position which can make it seem like it specificly points to the
@Dart annotation and says it's wrong.
This CL fixes the error so it's only issued when it should be.
It does not fix pointing semi-weirdly.
Fixes #42323
Bug: 42323
Change-Id: Id84ca06b2e4eca5912e65798ed2d86f8c89d71a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153769
Commit-Queue: Jens Johansen <[email protected]>
Reviewed-by: Johnni Winther <[email protected]>1 parent 9ae7fd2 commit 3199847
8 files changed
Lines changed: 140 additions & 17 deletions
File tree
- pkg/front_end
- lib/src/fasta/source
- testcases/incremental_initialize_from_dill
- test
- tests/dart2js
Lines changed: 28 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
453 | 453 | | |
454 | 454 | | |
455 | 455 | | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
456 | 476 | | |
457 | 477 | | |
458 | 478 | | |
| 479 | + | |
459 | 480 | | |
460 | 481 | | |
461 | 482 | | |
462 | 483 | | |
463 | 484 | | |
464 | 485 | | |
| 486 | + | |
| 487 | + | |
465 | 488 | | |
466 | 489 | | |
467 | 490 | | |
| |||
480 | 503 | | |
481 | 504 | | |
482 | 505 | | |
| 506 | + | |
| 507 | + | |
483 | 508 | | |
484 | 509 | | |
485 | 510 | | |
| |||
490 | 515 | | |
491 | 516 | | |
492 | 517 | | |
493 | | - | |
494 | | - | |
495 | | - | |
496 | | - | |
497 | | - | |
498 | | - | |
499 | | - | |
500 | | - | |
501 | | - | |
502 | | - | |
503 | | - | |
504 | | - | |
505 | | - | |
506 | 518 | | |
507 | 519 | | |
508 | 520 | | |
| |||
3780 | 3792 | | |
3781 | 3793 | | |
3782 | 3794 | | |
| 3795 | + | |
3783 | 3796 | | |
3784 | 3797 | | |
3785 | 3798 | | |
| |||
3807 | 3820 | | |
3808 | 3821 | | |
3809 | 3822 | | |
| 3823 | + | |
3810 | 3824 | | |
3811 | 3825 | | |
3812 | 3826 | | |
| |||
3830 | 3844 | | |
3831 | 3845 | | |
3832 | 3846 | | |
| 3847 | + | |
3833 | 3848 | | |
3834 | 3849 | | |
3835 | 3850 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
262 | 262 | | |
263 | 263 | | |
264 | 264 | | |
265 | | - | |
266 | | - | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
267 | 269 | | |
268 | 270 | | |
269 | 271 | | |
| |||
290 | 292 | | |
291 | 293 | | |
292 | 294 | | |
| 295 | + | |
293 | 296 | | |
294 | 297 | | |
295 | 298 | | |
| |||
354 | 357 | | |
355 | 358 | | |
356 | 359 | | |
357 | | - | |
| 360 | + | |
358 | 361 | | |
359 | 362 | | |
360 | 363 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
29 | 31 | | |
30 | 32 | | |
31 | 33 | | |
| |||
112 | 114 | | |
113 | 115 | | |
114 | 116 | | |
| 117 | + | |
115 | 118 | | |
116 | 119 | | |
117 | 120 | | |
| |||
328 | 331 | | |
329 | 332 | | |
330 | 333 | | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
331 | 340 | | |
332 | 341 | | |
333 | 342 | | |
| |||
458 | 467 | | |
459 | 468 | | |
460 | 469 | | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
461 | 473 | | |
462 | 474 | | |
463 | 475 | | |
| |||
481 | 493 | | |
482 | 494 | | |
483 | 495 | | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
484 | 506 | | |
485 | 507 | | |
486 | 508 | | |
| |||
Lines changed: 33 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
Lines changed: 33 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
0 commit comments