Skip to content

Commit d0ffce5

Browse files
committed
Fix more code to work with indentation always on
1 parent 3292231 commit d0ffce5

File tree

7 files changed

+62
-61
lines changed

7 files changed

+62
-61
lines changed

compiler/src/dotty/tools/backend/sjs/JSCodeGen.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -728,8 +728,8 @@ class JSCodeGen()(implicit ctx: Context) {
728728
else genExpr(tree)
729729

730730
//if (!isScalaJSDefinedJSClass(currentClassSym)) {
731-
val flags = js.MemberFlags.empty.withNamespace(namespace)
732-
js.MethodDef(flags, methodName, jsParams, resultIRType, Some(genBody()))(
731+
val flags = js.MemberFlags.empty.withNamespace(namespace)
732+
js.MethodDef(flags, methodName, jsParams, resultIRType, Some(genBody()))(
733733
optimizerHints, None)
734734
/*} else {
735735
assert(!namespace.isStatic, tree.span)

compiler/src/dotty/tools/backend/sjs/JSPositions.scala

+2-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ class JSPositions()(implicit ctx: Context) {
6666
case ScalaJSOptions.URIMap(from, to) if matches(from) =>
6767
val relURI = from.relativize(srcURI)
6868
to.fold(relURI)(_.resolve(relURI))
69-
} getOrElse*/ srcURI
69+
} getOrElse*/
70+
srcURI
7071
}
7172
}
7273
}

compiler/test/dotty/tools/DottyTest.scala

+14-13
Original file line numberDiff line numberDiff line change
@@ -81,19 +81,20 @@ trait DottyTest extends ContextEscapeDetection {
8181
(tree, context) =>
8282
implicit val ctx = context
8383
val findValDef: (List[tpd.ValDef], tpd.Tree) => List[tpd.ValDef] =
84-
(acc , tree) => { tree match {
85-
case t: tpd.ValDef if t.name.startsWith(dummyName) => t :: acc
86-
case _ => acc
87-
}
88-
}
89-
val d = new tpd.DeepFolder[List[tpd.ValDef]](findValDef).foldOver(Nil, tree)
90-
val tpes = d.map(_.tpe.widen).reverse
91-
val tpess = typeStringss.foldLeft[(List[Type], List[List[Type]])]((tpes, Nil)) {
92-
case ((rest, result), typeStrings) =>
93-
val (prefix, suffix) = rest.splitAt(typeStrings.length)
94-
(suffix, prefix :: result)
95-
}._2.reverse
96-
assertion(tpess, context)
84+
(acc , tree) => {
85+
tree match {
86+
case t: tpd.ValDef if t.name.startsWith(dummyName) => t :: acc
87+
case _ => acc
88+
}
89+
}
90+
val d = new tpd.DeepFolder[List[tpd.ValDef]](findValDef).foldOver(Nil, tree)
91+
val tpes = d.map(_.tpe.widen).reverse
92+
val tpess = typeStringss.foldLeft[(List[Type], List[List[Type]])]((tpes, Nil)) {
93+
case ((rest, result), typeStrings) =>
94+
val (prefix, suffix) = rest.splitAt(typeStrings.length)
95+
(suffix, prefix :: result)
96+
}._2.reverse
97+
assertion(tpess, context)
9798
}
9899
}
99100

compiler/test/dotty/tools/DottyTypeStealer.scala

+7-8
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,13 @@ object DottyTypeStealer extends DottyTest {
1818
(tree, context) =>
1919
implicit val ctx = context
2020
val findValDef: (List[ValDef], tpd.Tree) => List[ValDef] =
21-
(acc , tree) => { tree match {
22-
case t: ValDef if t.name.startsWith(dummyName) => t :: acc
23-
case _ => acc
24-
}
25-
}
26-
val d = new DeepFolder[List[ValDef]](findValDef).foldOver(Nil, tree)
27-
tp = d.map(_.tpe.widen).reverse
28-
scontext = context
21+
(acc , tree) => tree match {
22+
case t: ValDef if t.name.startsWith(dummyName) => t :: acc
23+
case _ => acc
24+
}
25+
val d = new DeepFolder[List[ValDef]](findValDef).foldOver(Nil, tree)
26+
tp = d.map(_.tpe.widen).reverse
27+
scontext = context
2928
}
3029
(scontext, tp)
3130
}

compiler/test/dotty/tools/backend/jvm/InlineBytecodeTests.scala

+10-10
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ class InlineBytecodeTests extends DottyBytecodeTest {
9595
Op(RETURN),
9696
Label(22)
9797
)
98-
assert(instructions == expected,
99-
"`track` was not properly inlined in `main`\n" + diffInstructions(instructions, expected))
98+
assert(instructions == expected,
99+
"`track` was not properly inlined in `main`\n" + diffInstructions(instructions, expected))
100100

101101
}
102102
}
@@ -155,8 +155,8 @@ class InlineBytecodeTests extends DottyBytecodeTest {
155155
Op(RETURN),
156156
Label(17)
157157
)
158-
assert(instructions == expected,
159-
"`track` was not properly inlined in `main`\n" + diffInstructions(instructions, expected))
158+
assert(instructions == expected,
159+
"`track` was not properly inlined in `main`\n" + diffInstructions(instructions, expected))
160160

161161
}
162162
}
@@ -215,8 +215,8 @@ class InlineBytecodeTests extends DottyBytecodeTest {
215215
Op(RETURN),
216216
Label(17)
217217
)
218-
assert(instructions == expected,
219-
"`track` was not properly inlined in `main`\n" + diffInstructions(instructions, expected))
218+
assert(instructions == expected,
219+
"`track` was not properly inlined in `main`\n" + diffInstructions(instructions, expected))
220220

221221
}
222222
}
@@ -276,8 +276,8 @@ class InlineBytecodeTests extends DottyBytecodeTest {
276276
Op(RETURN),
277277
Label(17)
278278
)
279-
assert(instructions == expected,
280-
"`track` was not properly inlined in `main`\n" + diffInstructions(instructions, expected))
279+
assert(instructions == expected,
280+
"`track` was not properly inlined in `main`\n" + diffInstructions(instructions, expected))
281281

282282
}
283283
}
@@ -315,8 +315,8 @@ class InlineBytecodeTests extends DottyBytecodeTest {
315315
, VarOp(ILOAD, 1)
316316
, Op(IRETURN)
317317
)
318-
assert(instructions == expected,
319-
"`f` was not properly inlined in `fun`\n" + diffInstructions(instructions, expected))
318+
assert(instructions == expected,
319+
"`f` was not properly inlined in `fun`\n" + diffInstructions(instructions, expected))
320320

321321
}
322322
}

doc-tool/test/dotty/tools/dottydoc/MarkdownTests.scala

+26-26
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class MarkdownTests extends DottyDocTest with CheckFromSource {
6969
.get
7070
.trim
7171

72-
assertEquals("""<p><a href="http://www.google.com">out</a></p>""", traitCmt)
72+
assertEquals("""<p><a href="http://www.google.com">out</a></p>""", traitCmt)
7373
}
7474
}
7575

@@ -92,7 +92,7 @@ class MarkdownTests extends DottyDocTest with CheckFromSource {
9292
.get
9393
.trim
9494

95-
assertEquals("""<p><a href="./None.html">None</a></p>""", traitCmt)
95+
assertEquals("""<p><a href="./None.html">None</a></p>""", traitCmt)
9696
}
9797
}
9898

@@ -115,7 +115,7 @@ class MarkdownTests extends DottyDocTest with CheckFromSource {
115115
.get
116116
.trim
117117

118-
assertEquals("""<p><a href="../scala/None.html">None</a></p>""", traitCmt)
118+
assertEquals("""<p><a href="../scala/None.html">None</a></p>""", traitCmt)
119119
}
120120
}
121121

@@ -141,12 +141,12 @@ class MarkdownTests extends DottyDocTest with CheckFromSource {
141141
.get
142142
.trim
143143

144-
assertEquals(
145-
"""|<ul>
146-
|<li>Item1</li>
147-
|<li>Item2</li>
148-
|<li>Item3</li>
149-
|</ul>""".stripMargin, traitCmt)
144+
assertEquals(
145+
"""|<ul>
146+
|<li>Item1</li>
147+
|<li>Item2</li>
148+
|<li>Item3</li>
149+
|</ul>""".stripMargin, traitCmt)
150150
}
151151
}
152152

@@ -174,17 +174,17 @@ class MarkdownTests extends DottyDocTest with CheckFromSource {
174174
.get
175175
.trim
176176

177-
assertEquals(
178-
"""|<ul>
179-
|<li>Item1
180-
|<ul>
181-
|<li>Item1a</li>
182-
|<li>Item1b</li>
183-
|</ul>
184-
|</li>
185-
|<li>Item2</li>
186-
|<li>Item3</li>
187-
|</ul>""".stripMargin, traitCmt)
177+
assertEquals(
178+
"""|<ul>
179+
|<li>Item1
180+
|<ul>
181+
|<li>Item1a</li>
182+
|<li>Item1b</li>
183+
|</ul>
184+
|</li>
185+
|<li>Item2</li>
186+
|<li>Item3</li>
187+
|</ul>""".stripMargin, traitCmt)
188188
}
189189
}
190190

@@ -210,9 +210,9 @@ class MarkdownTests extends DottyDocTest with CheckFromSource {
210210
.get
211211
.trim
212212

213-
assertEquals(
214-
"""|<pre><code class="language-scala">val x = 1 + 5
215-
|</code></pre>""".stripMargin, traitCmt)
213+
assertEquals(
214+
"""|<pre><code class="language-scala">val x = 1 + 5
215+
|</code></pre>""".stripMargin, traitCmt)
216216
}
217217
}
218218

@@ -241,9 +241,9 @@ class MarkdownTests extends DottyDocTest with CheckFromSource {
241241
.get
242242
.trim
243243

244-
assertEquals(
245-
"""|<pre><code class="language-scala">val x = 1 + 5
246-
|</code></pre>""".stripMargin, traitCmt)
244+
assertEquals(
245+
"""|<pre><code class="language-scala">val x = 1 + 5
246+
|</code></pre>""".stripMargin, traitCmt)
247247
}
248248
}
249249

tests/patmat/patmatexhaust.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class TestSealedExhaustive { // compile only
6363

6464
def ma7() = List(1,2) match { //exhaustive
6565
case 1::2::Nil =>
66-
case _ =>
66+
case _ =>
6767
}
6868

6969
sealed class B

0 commit comments

Comments
 (0)