Commit 6cb3382
committed
Sema: Fix source ranges for string literals in TypeRefinementContext.
Since string literals are only a single token from the perspective of the
parser, the source range for a pattern binding decl that is initialized with a
string literal expression only extends to the beginning of the string literal.
To ensure the TypeRefinementContext for a pattern binding decl includes the
entire contents of the init expression we must calculate the character source
range of the decl instead.
Resolves rdar://110952225 and #77050.1 parent 4c45a4d commit 6cb3382
File tree
2 files changed
+20
-5
lines changed- lib/Sema
- test/Sema
2 files changed
+20
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
782 | 782 | | |
783 | 783 | | |
784 | 784 | | |
| 785 | + | |
| 786 | + | |
785 | 787 | | |
786 | 788 | | |
787 | 789 | | |
788 | | - | |
| 790 | + | |
789 | 791 | | |
790 | 792 | | |
791 | 793 | | |
| |||
797 | 799 | | |
798 | 800 | | |
799 | 801 | | |
800 | | - | |
801 | | - | |
| 802 | + | |
| 803 | + | |
802 | 804 | | |
803 | 805 | | |
804 | | - | |
| 806 | + | |
| 807 | + | |
805 | 808 | | |
806 | 809 | | |
807 | 810 | | |
| |||
827 | 830 | | |
828 | 831 | | |
829 | 832 | | |
830 | | - | |
| 833 | + | |
831 | 834 | | |
832 | 835 | | |
833 | 836 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
299 | 299 | | |
300 | 300 | | |
301 | 301 | | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
302 | 314 | | |
303 | 315 | | |
304 | 316 | | |
| |||
0 commit comments