Skip to content
This repository was archived by the owner on Mar 12, 2026. It is now read-only.

Commit b301ab9

Browse files
committed
Upgrade Scala 3.5.2 → 3.8.2 and sbt 1.10.6 → 1.11.6
Fix 26 new warnings from stricter Scala 3.8 compiler: - Remove unused imports and pattern variables - Add @unused annotations for intentionally kept params - Suppress false positive on SimParams case class defaults - Remove BankId.== extension (E194 shadowing)
1 parent f117536 commit b301ab9

23 files changed

Lines changed: 50 additions & 45 deletions

build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
val scala3Version = "3.5.2"
1+
val scala3Version = "3.8.2"
22

33
lazy val root = project
44
.in(file("."))

project/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version=1.10.6
1+
sbt.version=1.11.6

src/main/scala/sfc/agents/Banking.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package sfc.agents
22

33
import sfc.config.SimParams
4-
import sfc.engine.*
54
import sfc.engine.mechanisms.{Macroprudential, YieldCurve}
65
import sfc.types.*
76
import sfc.util.KahanSum.*

src/main/scala/sfc/agents/Household.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -690,14 +690,14 @@ object Household:
690690
/** Base income, benefit, and updated status for one HH. */
691691
private def computeIncome(hh: State)(using SimParams): (PLN, PLN, HhStatus) =
692692
hh.status match
693-
case HhStatus.Employed(firmId, sectorIdx, wage) =>
693+
case HhStatus.Employed(firmId, sectorIdx, wage) =>
694694
(wage, PLN.Zero, hh.status)
695-
case HhStatus.Unemployed(months) =>
695+
case HhStatus.Unemployed(months) =>
696696
val benefit = computeBenefit(months)
697697
(benefit, benefit, HhStatus.Unemployed(months + 1))
698-
case HhStatus.Retraining(monthsLeft, target, cost) =>
698+
case HhStatus.Retraining(monthsLeft, _, cost) =>
699699
(PLN.Zero, PLN.Zero, hh.status)
700-
case HhStatus.Bankrupt =>
700+
case HhStatus.Bankrupt =>
701701
(PLN.Zero, PLN.Zero, HhStatus.Bankrupt)
702702

703703
/** Skill decay for long-term unemployed (onset after scarringOnset months).

src/main/scala/sfc/agents/Immigration.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ object Immigration:
2323
/** Monthly immigration inflow. Exogenous: fixed rate × workingAgePop.
2424
* Endogenous: responds to (domesticWage / foreignWage − 1) × elasticity.
2525
*/
26-
def computeInflow(workingAgePop: Int, wage: PLN, unempRate: Double, month: Int)(using p: SimParams): Int =
26+
def computeInflow(workingAgePop: Int, wage: PLN, unempRate: Double, @scala.annotation.unused month: Int)(using p: SimParams): Int =
2727
if !p.flags.immigration then 0
2828
else if p.flags.immigEndogenous then
2929
val wageGap = (wage.toDouble / p.immigration.foreignWage.toDouble - 1.0).max(0.0)

src/main/scala/sfc/agents/Nbfi.scala

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -121,16 +121,16 @@ object Nbfi:
121121
*/
122122
def step(
123123
prev: State,
124-
employed: Int, // employed workers
125-
wage: PLN, // average monthly wage
126-
priceLevel: Double, // CPI price level (unused in current spec, kept for interface stability)
127-
unempRate: Ratio, // unemployment rate
128-
bankNplRatio: Ratio, // aggregate bank NPL ratio (tightness signal)
129-
govBondYield: Rate, // government bond yield (annualised)
130-
corpBondYield: Rate, // corporate bond yield (annualised)
131-
equityReturn: Rate, // equity monthly return
132-
depositRate: Rate, // bank deposit rate (TFI opportunity cost)
133-
domesticCons: PLN, // domestic consumption (NBFI credit base)
124+
employed: Int, // employed workers
125+
wage: PLN, // average monthly wage
126+
@scala.annotation.unused priceLevel: Double, // CPI price level (unused in current spec, kept for interface stability)
127+
unempRate: Ratio, // unemployment rate
128+
bankNplRatio: Ratio, // aggregate bank NPL ratio (tightness signal)
129+
govBondYield: Rate, // government bond yield (annualised)
130+
corpBondYield: Rate, // corporate bond yield (annualised)
131+
equityReturn: Rate, // equity monthly return
132+
depositRate: Rate, // bank deposit rate (TFI opportunity cost)
133+
domesticCons: PLN, // domestic consumption (NBFI credit base)
134134
)(using p: SimParams): State =
135135
// TFI: inflow + investment income + rebalance
136136
val netInflow = tfiInflow(employed, wage, equityReturn, govBondYield, depositRate)

src/main/scala/sfc/config/SimParams.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ case class SectorDef(
4747
* Polish GDP (~3.5 bln PLN). Do NOT construct SimParams directly with unscaled
4848
* values — always start from `defaults` and use `.copy()`.
4949
*/
50+
@annotation.nowarn("msg=unused private member") // Scala 3.8 false positive: defaults used via copy()
5051
case class SimParams private (
5152
flags: FeatureFlags = FeatureFlags(),
5253
pop: PopulationConfig = PopulationConfig(),

src/main/scala/sfc/engine/Simulation.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package sfc.engine
33
import sfc.accounting.*
44
import sfc.agents.*
55
import sfc.config.*
6-
import sfc.types.*
76

87
import scala.util.Random
98

src/main/scala/sfc/engine/markets/IntermediateMarket.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package sfc.engine.markets
22

3-
import sfc.agents.{Firm, TechState}
3+
import sfc.agents.Firm
44
import sfc.config.SimParams
55
import sfc.types.*
66
import sfc.util.KahanSum.*

src/main/scala/sfc/engine/markets/LaborMarket.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ object LaborMarket:
8383
households: Vector[Household.State],
8484
firms: Vector[Firm.State],
8585
marketWage: PLN,
86-
rng: Random,
86+
@scala.annotation.unused rng: Random,
8787
)(using p: SimParams): JobSearchResult =
8888
val vacancies = computeVacancies(households, firms)
8989
if vacancies.isEmpty then JobSearchResult(households, 0)

0 commit comments

Comments
 (0)