Skip to content

Commit e7d8e1e

Browse files
committed
Get rid of deprecation warnings
1 parent c8b86fb commit e7d8e1e

File tree

5 files changed

+5
-15
lines changed

5 files changed

+5
-15
lines changed

build.sbt

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ lazy val root = project
1313

1414
scalaVersion := scala3Version,
1515

16-
scalacOptions ++= Seq("-Wunused:all"),
16+
scalacOptions ++= Seq("-Wunused:all", "-deprecation"),
1717

1818
libraryDependencies ++= Seq(
1919
"org.typelevel" %% "cats-parse" % "0.3.9",

src/test/scala/fred/ExecTests.scala

+1-4
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,7 @@ object ExecTests {
139139
}
140140

141141
if (print) {
142-
Files.write(
143-
Path.of("/home", "ysthakur", "fred", "foo.c"),
144-
generatedC.getBytes()
145-
)
142+
Files.write(Path.of("foo.c"), generatedC.getBytes())
146143
}
147144

148145
Compiler.invokeGCC(generatedC, "a.out")

src/test/scala/fred/FuzzTests.scala

+1-3
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ class FuzzTests
2424
given PropertyCheckConfiguration =
2525
PropertyCheckConfiguration(minSize = 1, sizeRange = 30)
2626

27-
given [T]: Shrink[T] = Shrink(_ => Stream.empty)
28-
2927
def genVars(
3028
typ: TypeDef,
3129
prevTypes: Map[String, Map[String, Expr]]
@@ -128,7 +126,7 @@ class FuzzTests
128126
assignExprs <- GenerateTypes
129127
.sequence(
130128
allTypes.filterNot(_.name.startsWith("Opt")).map { typ =>
131-
createCycles(typ, allVars.mapValues(_.keySet).toMap)
129+
createCycles(typ, allVars.view.mapValues(_.keySet).toMap)
132130
}
133131
)
134132
.map(_.flatten)

src/test/scala/fred/GenerateTypes.scala

-3
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,10 @@ package fred
33
import scala.jdk.CollectionConverters.*
44

55
import org.scalacheck.Gen
6-
import org.scalacheck.Shrink
76

87
object GenerateTypes {
98
val SomeField = "value"
109

11-
given noShrink[T]: Shrink[T] = Shrink(_ => Stream.empty)
12-
1310
case class GenTypeAux(refs: List[Int])
1411

1512
def sequence[T](gens: Iterable[Gen[T]]): Gen[List[T]] =

src/test/scala/fred/SCCTests.scala

+2-4
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class SCCTests
1515
def createFile(graph: Map[String, Set[(Boolean, String)]]): ParsedFile = {
1616
ParsedFile(
1717
GenerateTypes.toTypeDefs(
18-
graph
18+
graph.view
1919
.mapValues(_.map((mut, typeName) => (mut, s"f$typeName", typeName)))
2020
.toMap
2121
),
@@ -24,7 +24,7 @@ class SCCTests
2424
}
2525

2626
def createFileImmutable(graph: Map[String, Set[String]]): ParsedFile = {
27-
createFile(graph.mapValues(_.map(false -> _)).toMap)
27+
createFile(graph.view.mapValues(_.map(false -> _)).toMap)
2828
}
2929

3030
def simplifySCCs(sccs: List[Set[TypeDef]]): List[Set[String]] = {
@@ -134,8 +134,6 @@ class SCCTests
134134
test("SCCs valid for not-so-arbitrary types") {
135135
// Ensure that the algorithm doesn't lump every type into the same SCC
136136

137-
given [T]: Shrink[T] = GenerateTypes.noShrink
138-
139137
// Generate a bunch of types. Types that come later in the list can only have
140138
// references to types that come earlier in the list (or themselves).
141139
// Therefore, each type is its own strongly-connected component.

0 commit comments

Comments
 (0)