Skip to content

Commit 2395540

Browse files
committed
prepare for Dotty: avoid anonymous structural types
1 parent 7a1029f commit 2395540

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

junit/src/test/scala/scala/collection/concurrent/ctries_new/Spec.scala

+4-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,10 @@ trait Spec {
2727
def shouldEqual(other: Any) = assert(a == other)
2828
}
2929

30-
def evaluating[U](body: =>U) = new {
31-
def shouldProduce[T <: Throwable: ClassTag]() = {
30+
trait HasShouldProduce[U] { def shouldProduce[T <: Throwable: ClassTag](): Unit }
31+
32+
def evaluating[U](body: =>U): HasShouldProduce[U] = new HasShouldProduce[U] {
33+
override def shouldProduce[T <: Throwable: ClassTag]() = {
3234
var produced = false
3335
try body
3436
catch {

junit/src/test/scala/scala/collection/concurrent/ctries_old/Spec.scala

+4-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,10 @@ trait Spec {
2727
def shouldEqual(other: Any) = assert(a == other)
2828
}
2929

30-
def evaluating[U](body: =>U) = new {
31-
def shouldProduce[T <: Throwable: ClassTag]() = {
30+
trait HasShouldProduce[U] { def shouldProduce[T <: Throwable: ClassTag](): Unit }
31+
32+
def evaluating[U](body: =>U): HasShouldProduce[U] = new HasShouldProduce[U] {
33+
override def shouldProduce[T <: Throwable: ClassTag]() = {
3234
var produced = false
3335
try body
3436
catch {

0 commit comments

Comments
 (0)