Commit 36f51b6
Fix wrong warning 20 range in sequential expressions (#5735)
In TcStmt, use the range of the last expression in a sequential chain
for warnings, so "expression is ignored" diagnostics point at the
offending expression rather than the entire sequential body.
Add regression tests for for-loops and while-loops with non-unit last
expressions (int, string types). Add release notes.
Agent-Logs-Url: https://github.com/dotnet/fsharp/sessions/e2b8a05e-e65e-484e-b039-cc8723adb177
Co-authored-by: abonie <20281641+abonie@users.noreply.github.com>1 parent b224b79 commit 36f51b6
3 files changed
Lines changed: 68 additions & 1 deletion
File tree
- docs/release-notes/.FSharp.Compiler.Service
- src/Compiler/Checking/Expressions
- tests/FSharp.Compiler.ComponentTests/ErrorMessages
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5522 | 5522 | | |
5523 | 5523 | | |
5524 | 5524 | | |
5525 | | - | |
| 5525 | + | |
| 5526 | + | |
| 5527 | + | |
| 5528 | + | |
| 5529 | + | |
| 5530 | + | |
| 5531 | + | |
| 5532 | + | |
| 5533 | + | |
| 5534 | + | |
5526 | 5535 | | |
5527 | 5536 | | |
5528 | 5537 | | |
| |||
Lines changed: 57 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
179 | 236 | | |
180 | 237 | | |
181 | 238 | | |
| |||
0 commit comments