Skip to content

Commit c0faa9a

Browse files
committed
Scala 3.0.0, Scalatest 3.2.9.
Apply workarounds for scala/scala3#12508
1 parent 5df352b commit c0faa9a

File tree

3 files changed

+28
-21
lines changed

3 files changed

+28
-21
lines changed

build.sbt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
resolvers += Resolver.mavenCentral
22

3-
ThisBuild / scalaVersion := "3.0.0-RC3"
3+
ThisBuild / scalaVersion := "3.0.0"
44

55
ThisBuild / organization := "com.github.tomasmikula"
66

@@ -57,7 +57,7 @@ lazy val core = project
5757
"-Ykind-projector", // support '*' as a placeholder in type lambdas
5858
),
5959
libraryDependencies ++= Seq(
60-
"org.scalatest" %% "scalatest" % "3.2.8" % "test",
60+
"org.scalatest" %% "scalatest" % "3.2.9" % "test",
6161
),
6262
)
6363

core/src/test/scala/libretto/BasicTests.scala

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -175,12 +175,31 @@ class BasicTests extends TestSuite {
175175
assertCompletes(prg)
176176
}
177177

178-
test("coDistribute") {
178+
{
179+
// temporarily moved outside the next `test` body due to https://github.com/lampepfl/dotty/issues/12508
180+
179181
type B = Val[Boolean]
180182
type C = Val[Char]
181183
type I = Val[Int]
182184
type S = Val[String]
183185

186+
case class Combination[X, Y](
187+
choose1: (B |&| C) -⚬ Val[X],
188+
choose2: (I |&| S) -⚬ Val[Y],
189+
expectedX: X,
190+
expectedY: Y,
191+
) {
192+
type T = X
193+
type U = Y
194+
195+
def go: ((B |&| C) |*| (I |&| S)) -⚬ Val[(T, U)] =
196+
par(choose1, choose2) > unliftPair
197+
198+
def expected: (T, U) =
199+
(expectedX, expectedY)
200+
}
201+
202+
test("coDistribute") {
184203
// (false 1) (true "foo") ('a' 2) ('b' "bar")
185204
val init: Done -⚬ (((B |*| I) |&| (B |*| S)) |&| ((C |*| I) |&| (C |*| S))) =
186205
choice(
@@ -205,22 +224,6 @@ class BasicTests extends TestSuite {
205224
.bimap(coDistributeR, coDistributeR) .to[ ((B |&| C) |*| I ) |&| ((B |&| C) |*| S ) ]
206225
.>(coDistributeL) .to[ (B |&| C) |*| (I |&| S ) ]
207226

208-
case class Combination[X, Y](
209-
choose1: (B |&| C) -⚬ Val[X],
210-
choose2: (I |&| S) -⚬ Val[Y],
211-
expectedX: X,
212-
expectedY: Y,
213-
) {
214-
type T = X
215-
type U = Y
216-
217-
def go: ((B |&| C) |*| (I |&| S)) -⚬ Val[(T, U)] =
218-
par(choose1, choose2) > unliftPair
219-
220-
def expected: (T, U) =
221-
(expectedX, expectedY)
222-
}
223-
224227
val combinations = Seq(
225228
Combination(chooseL, chooseL, false, 1),
226229
Combination(chooseL, chooseR, true, "foo"),
@@ -235,6 +238,7 @@ class BasicTests extends TestSuite {
235238
assertVal(f > c.go, c.expected)
236239
}
237240
}
241+
}
238242

239243
test("LList.splitEvenOdd") {
240244
val prg: Done -⚬ Val[(List[Int], List[Int])] =
@@ -254,14 +258,16 @@ class BasicTests extends TestSuite {
254258
assertVal(prg, List((1, 2), (3, 4), (5, 0)))
255259
}
256260

257-
test("acquire - effect - transform - release") {
261+
{
262+
// temporarily moved outside the next `test` body due to https://github.com/lampepfl/dotty/issues/12508
258263
class MVar[A](var value: A) {
259264
def set(a: A): MVar[A] = {
260265
this.value = a
261266
this
262267
}
263268
}
264269

270+
test("acquire - effect - transform - release") {
265271
val acquireFuns = Seq[Val[Int] -⚬ Res[MVar[Int]]](
266272
mVal(new MVar(_)),
267273
acquire0(new MVar(_), release = None),
@@ -304,6 +310,7 @@ class BasicTests extends TestSuite {
304310
assertVal(prg, "1")
305311
}
306312
}
313+
}
307314

308315
test("release via registered function") {
309316
val ref = new java.util.concurrent.atomic.AtomicReference[String]("init")

scripts/scaladoc-snapshot.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ set -eu # exit on first failed command
33
sbt doc
44
git rm -rf docs/scaladoc/snapshot
55
mkdir -p docs/scaladoc
6-
cp -R core/target/scala-3.0.0-RC3/api docs/scaladoc/snapshot
6+
cp -R core/target/scala-3.0.0/api docs/scaladoc/snapshot
77

88
# Edit stylesheet to use a font that correctly renders Unicode boxes (box-drawing characters).
99
# TODO: Is there a better way to override the font used for code blocks?

0 commit comments

Comments
 (0)