Commit 0e94917
committed
Don't insert semicolons in conditions unless indented
In a statement like this
```scala
if foo
(bar)
then
```
we would never expect a semicolon to be inserted between `foo` and `bar`. The `foo`
would need to be indented itself for this to happen.
So, the following is OK
```scala
if
val x = ...
x > 0
then
```
But the following is not:
```scala
if val x = ...
x > 0
```
Fixes #127571 parent fcd837a commit 0e94917
File tree
2 files changed
+13
-4
lines changed- compiler/src/dotty/tools/dotc/parsing
- tests/pos
2 files changed
+13
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
76 | | - | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
77 | 78 | | |
78 | 79 | | |
79 | 80 | | |
| |||
167 | 168 | | |
168 | 169 | | |
169 | 170 | | |
170 | | - | |
| 171 | + | |
171 | 172 | | |
172 | 173 | | |
173 | 174 | | |
| |||
2553 | 2554 | | |
2554 | 2555 | | |
2555 | 2556 | | |
2556 | | - | |
| 2557 | + | |
2557 | 2558 | | |
2558 | 2559 | | |
2559 | 2560 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
0 commit comments