diff options
Diffstat (limited to 'src/main/scala/scala/async')
-rw-r--r-- | src/main/scala/scala/async/internal/TransformUtils.scala | 17 |
1 files changed, 7 insertions, 10 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 |