Skip to content

Commit 05ceef9

Browse files
committed
Fix errors in code patch by Scala 3 compiler
It seems that when the compiler rewrites source code to the no-indentation based syntax, it omits closing curly braces in some spots. I didn't discover a specific pattern in the spots where the closing '}' are omitted. So, it's not obvious to create minimised reproductions...
1 parent c4b9e91 commit 05ceef9

File tree

6 files changed

+12
-0
lines changed

6 files changed

+12
-0
lines changed

src/main/scala/org/lunatechlabs/dotty/SudokuSolverMain.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,5 @@ object SudokuSolverMain {
4848
println(s"${GREEN}Hit RETURN to stop solver${RESET}")
4949
StdIn.readLine()
5050
system.terminate()
51+
}
5152
}

src/main/scala/org/lunatechlabs/dotty/sudoku/ReductionRules.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,5 @@ object ReductionRules {
3838
reductionSet.zipWithIndex.foldRight(Vector.empty[CellContent]) { case ((cellValue, cellIndex), acc) =>
3939
cellIndexToReducedValue.getOrElse(cellIndex, cellValue) +: acc
4040
}
41+
}
4142
}

src/main/scala/org/lunatechlabs/dotty/sudoku/SudokuDetailProcessor.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ object SudokuDetailProcessor {
4646
def sendUpdate(id: Int, cellUpdates: CellUpdates)(implicit sender: ActorRef[Response]): Unit =
4747
sender ! BlockUpdate(id, cellUpdates)
4848
def processorName(id: Int): String = s"blk-processor-$id"
49+
}
4950
}
5051

5152
class SudokuDetailProcessor[DetailType <: SudokuDetailType: UpdateSender] private (
@@ -73,6 +74,7 @@ class SudokuDetailProcessor[DetailType <: SudokuDetailType: UpdateSender] privat
7374
val updateSender = implicitly[UpdateSender[DetailType]]
7475
updateSender.sendUpdate(id, stateChanges(state, transformedUpdatedState))(replyTo)
7576
operational(id, transformedUpdatedState, isFullyReduced(transformedUpdatedState))
77+
}
7678
}
7779

7880
case Update(_, replyTo) =>
@@ -105,4 +107,5 @@ class SudokuDetailProcessor[DetailType <: SudokuDetailType: UpdateSender] privat
105107
private def isFullyReduced(state: ReductionSet): Boolean = {
106108
val allValuesInState = state.flatten
107109
allValuesInState == allValuesInState.distinct
110+
}
108111
}

src/main/scala/org/lunatechlabs/dotty/sudoku/SudokuIO.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,17 +54,20 @@ object SudokuIO {
5454
else {
5555
cachedLine = Some(line)
5656
true
57+
}
5758
}
5859
catch {
5960
case e: java.io.IOError =>
6061
throw new IllegalStateException(e.toString)
62+
}
6163
}
6264

6365
override def next(): String = {
6466
if !hasNext then throw new NoSuchElementException("No more lines in file")
6567
val currentLine = cachedLine.get
6668
cachedLine = None
6769
currentLine
70+
}
6871
}
6972
override def toString: String =
7073
"{Lines of " + file.getAbsolutePath + "}"
@@ -92,4 +95,5 @@ object SudokuIO {
9295
.zipWithIndex
9396

9497
convertFromCellsToComplete(cellsIn)
98+
}
9599
}

src/main/scala/org/lunatechlabs/dotty/sudoku/SudokuSolverSettings.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@ class SudokuSolverSettings(config: Config) {
1919

2020
val SendInterval: FiniteDuration =
2121
Duration(config.getDuration("sudoku-solver.problem-sender.send-interval", Millis), Millis)
22+
}
2223
}

src/main/scala/org/lunatechlabs/dotty/sudoku/package.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ package object sudoku {
3333
}
3434
yield y
3535
SudokuField(sudoku)
36+
}
3637
}
3738

3839
implicit class SudokuFieldOps(val sudokuField: SudokuField) extends AnyVal {
@@ -78,4 +79,5 @@ package object sudoku {
7879
.map { case (c, i) =>
7980
RowUpdate(i, c.map(_.swap))
8081
}
82+
}
8183
}

0 commit comments

Comments
 (0)