aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSeth Tisue <seth@tisue.net>2018-05-01 13:05:04 +0200
committerSeth Tisue <seth@tisue.net>2018-05-01 13:05:04 +0200
commitf8a5b0048bd08a3bdcdffd1395954e0e92ee753b (patch)
tree3b5c8cc1223bf762613af333d6a1ff7b380a8ff5 /src
parente3250b48620b8e4a3651d097ecc4c437586a2d82 (diff)
downloadscala-async-f8a5b0048bd08a3bdcdffd1395954e0e92ee753b.tar.gz
scala-async-f8a5b0048bd08a3bdcdffd1395954e0e92ee753b.tar.bz2
scala-async-f8a5b0048bd08a3bdcdffd1395954e0e92ee753b.zip
drop support for Scala 2.11 as of 0.10.0
also upgrade Scala 2.12.4 -> 2.12.6
Diffstat (limited to 'src')
-rw-r--r--src/main/scala/scala/async/internal/TransformUtils.scala17
-rw-r--r--src/test/scala/scala/async/run/uncheckedBounds/UncheckedBoundsSpec.scala26
2 files changed, 9 insertions, 34 deletions
diff --git a/src/main/scala/scala/async/internal/TransformUtils.scala b/src/main/scala/scala/async/internal/TransformUtils.scala
index 016ffc1..be56bb7 100644
--- a/src/main/scala/scala/async/internal/TransformUtils.scala
+++ b/src/main/scala/scala/async/internal/TransformUtils.scala
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2012-2014 Lightbend Inc. <http://www.lightbend.com>
+ * Copyright (C) 2012-2018 Lightbend Inc. <http://www.lightbend.com>
*/
package scala.async.internal
@@ -406,15 +406,12 @@ private[async] trait TransformUtils {
}
// =====================================
- // Copy/Pasted from Scala 2.10.3. See SI-7694.
- private lazy val UncheckedBoundsClass = {
- try c.mirror.staticClass("scala.reflect.internal.annotations.uncheckedBounds")
- catch { case _: ScalaReflectionException => NoSymbol }
- }
- final def uncheckedBounds(tp: Type): Type = {
- if ((tp.typeArgs.isEmpty && (tp match { case _: TypeRef => true; case _ => false}))|| UncheckedBoundsClass == NoSymbol) tp
+ // Copy/Pasted from Scala 2.10.3. See scala/bug#7694
+ private lazy val UncheckedBoundsClass =
+ c.mirror.staticClass("scala.reflect.internal.annotations.uncheckedBounds")
+ final def uncheckedBounds(tp: Type): Type =
+ if ((tp.typeArgs.isEmpty && (tp match { case _: TypeRef => true; case _ => false}))) tp
else withAnnotation(tp, Annotation(UncheckedBoundsClass.asType.toType, Nil, ListMap()))
- }
// =====================================
/**
@@ -608,4 +605,4 @@ private[async] trait TransformUtils {
}
case object ContainsAwait
-case object NoAwait \ No newline at end of file
+case object NoAwait
diff --git a/src/test/scala/scala/async/run/uncheckedBounds/UncheckedBoundsSpec.scala b/src/test/scala/scala/async/run/uncheckedBounds/UncheckedBoundsSpec.scala
index 5eb1f32..e728242 100644
--- a/src/test/scala/scala/async/run/uncheckedBounds/UncheckedBoundsSpec.scala
+++ b/src/test/scala/scala/async/run/uncheckedBounds/UncheckedBoundsSpec.scala
@@ -7,8 +7,7 @@ import scala.async.TreeInterrogation
class UncheckedBoundsSpec {
@Test def insufficientLub_SI_7694() {
- suppressingFailureBefore2_10_3 {
- eval( s"""
+ eval( s"""
object Test {
import _root_.scala.async.run.toughtype._
import _root_.scala.async.internal.AsyncId.{async, await}
@@ -17,12 +16,10 @@ class UncheckedBoundsSpec {
}
}
""", compileOptions = s"-cp ${toolboxClasspath} ")
- }
}
@Test def insufficientLub_SI_7694_ScalaConcurrent() {
- suppressingFailureBefore2_10_3 {
- eval( s"""
+ eval( s"""
object Test {
import _root_.scala.async.run.toughtype._
import _root_.scala.async.Async.{async, await}
@@ -33,25 +30,6 @@ class UncheckedBoundsSpec {
}
}
""", compileOptions = s"-cp ${toolboxClasspath} ")
- }
}
- private def suppressingFailureBefore2_10_3(body: => Any) {
- try {
- body
- } catch {
- case x: Throwable =>
- // @uncheckedBounds was only introduced in 2.10.3/ 2.11.0-M5, so avoid reporting this test failure in those cases.
- scala.util.Properties.versionNumberString match {
- case "2.10.0" | "2.10.1" | "2.10.2" | "2.11.0-M4" => // ignore, the @uncheckedBounds doesn't exist yet
- case _ =>
- val annotationExists =
- reflect.runtime.currentMirror.staticClass("scala.reflect.internal.annotations.uncheckedBounds") == reflect.runtime.universe.NoSymbol
- if (annotationExists)
- Assert.fail("@uncheckedBounds not found in scala-reflect.jar")
- else
- Assert.fail(s"@uncheckedBounds exists, but it didn't prevent this failure: $x")
- }
- }
- }
}