Commit c6afb38
committed
Patch indentation when removing braces (essentials)
If the first indentation of the region is greater than the indentation
of the enclosing region, we use it to indent the whole region.
Otherwise we use the incremented indentation of the enclosing region.
```scala
def foo = {
x // we replicate indentation of x downward in region
y
}
```
```scala
def foo = {
x // indentation of x is incorrect, we increment enclosing indentation
y
}
```
A bigger indentation than the required one is permitted except
just after a closing brace.
```scala
def bar = {
x
.toString // permitted indentation
def foo = {
}
bar // must be unindented, to not fall into the body of foo
}
```
And other bug fixes (see lampepfl#17522)1 parent d5a7131 commit c6afb38
File tree
5 files changed
+246
-124
lines changed- compiler/src/dotty/tools/dotc
- parsing
- xml
- rewrites
- tests/pos
5 files changed
+246
-124
lines changed
0 commit comments