Commit 11e905a
committed
syntax.md: support multiple if-guards on same line
Consider the example:
```scala
for {
x <- 1 to 5
if true; if true; if true
} yield x
```
Note, that multiple if guards start from a new line and are not separated with a semicolon or a new line.
This code is compiled ok in Scala 3 and is a valid code according to Scala 2 syntax reference:
(though looks like there is a bug in implementation scala/bug#12323)
But it's not supported according to the Scala 3 syntax reference.
related issues:
scala/bug#12323
https://youtrack.jetbrains.com/issue/SCL-132201 parent 49c59f5 commit 11e905a
File tree
3 files changed
+6
-6
lines changed- compiler/src/dotty/tools/dotc/parsing
- docs/docs
- internals
- reference
3 files changed
+6
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2459 | 2459 | | |
2460 | 2460 | | |
2461 | 2461 | | |
2462 | | - | |
| 2462 | + | |
2463 | 2463 | | |
2464 | 2464 | | |
2465 | 2465 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
269 | 269 | | |
270 | 270 | | |
271 | 271 | | |
272 | | - | |
| 272 | + | |
273 | 273 | | |
274 | | - | |
| 274 | + | |
275 | 275 | | |
276 | 276 | | |
277 | 277 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
264 | 264 | | |
265 | 265 | | |
266 | 266 | | |
267 | | - | |
268 | | - | |
269 | | - | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
270 | 270 | | |
271 | 271 | | |
272 | 272 | | |
| |||
0 commit comments