Commit 6bbc101
committed
[Diagnostics] Correctly diagnose situations when immutable value is passed to
Currently the note is going to point to the "callee" but that is
incorrect when the failure is related to an argument of a call.
Detect this situation in `RValueTreatedAsLValueFailure::diagnoseAsNote`
and produce a correct note.
Resolves: rdar://150689994inout parameter1 parent 622475b commit 6bbc101
File tree
3 files changed
+45
-1
lines changed- include/swift/AST
- lib/Sema
- test/Constraints
3 files changed
+45
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5177 | 5177 | | |
5178 | 5178 | | |
5179 | 5179 | | |
| 5180 | + | |
| 5181 | + | |
| 5182 | + | |
5180 | 5183 | | |
5181 | 5184 | | |
5182 | 5185 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2049 | 2049 | | |
2050 | 2050 | | |
2051 | 2051 | | |
2052 | | - | |
| 2052 | + | |
| 2053 | + | |
| 2054 | + | |
2053 | 2055 | | |
2054 | 2056 | | |
2055 | 2057 | | |
2056 | 2058 | | |
| 2059 | + | |
| 2060 | + | |
| 2061 | + | |
| 2062 | + | |
| 2063 | + | |
| 2064 | + | |
| 2065 | + | |
| 2066 | + | |
| 2067 | + | |
| 2068 | + | |
| 2069 | + | |
2057 | 2070 | | |
2058 | 2071 | | |
2059 | 2072 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
349 | 349 | | |
350 | 350 | | |
351 | 351 | | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
0 commit comments