Skip to content

drop support for Scala 2.11 as of 0.10.0 #195

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 4, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ jdk:
notifications:
email:
- [email protected]
- [email protected]
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
# scala-async [<img src="https://img.shields.io/maven-central/v/org.scala-lang.modules/scala-async_2.11.svg?label=latest%20release%20for%202.11"/>](http://search.maven.org/#search%7Cga%7C1%7Cg%3Aorg.scala-lang.modules%20a%3Ascala-async_2.11) [<img src="https://img.shields.io/maven-central/v/org.scala-lang.modules/scala-async_2.12.svg?label=latest%20release%20for%202.12"/>](http://search.maven.org/#search%7Cga%7C1%7Cg%3Aorg.scala-lang.modules%20a%3Ascala-async_2.12)
# scala-async [[<img src="https://img.shields.io/maven-central/v/org.scala-lang.modules/scala-async_2.12.svg?label=latest%20release%20for%202.12"/>](http://search.maven.org/#search%7Cga%7C1%7Cg%3Aorg.scala-lang.modules%20a%3Ascala-async_2.12)

## Supported Scala versions

This branch targets Scala 2.11, 2.12, and 2.13.
This branch targets Scala 2.12 and 2.13.

Support for Scala 2.10 is [on a branch](https://github.com/scala/async/tree/2.10.x).
Support for Scala 2.11 is [on a branch](https://github.com/scala/scala-async/tree/2.11.x).

Support for Scala 2.10 is [on a branch](https://github.com/scala/scala-async/tree/2.10.x).

## Quick start

To include scala-async in an existing project use the library published on Maven Central.
For sbt projects add the following to your build definition - build.sbt or project/Build.scala:

```scala
libraryDependencies += "org.scala-lang.modules" %% "scala-async" % "0.9.7"
libraryDependencies += "org.scala-lang.modules" %% "scala-async" % "0.10.0"
```

For Maven projects add the following to your <dependencies> (make sure to use the correct Scala version suffix
Expand All @@ -22,7 +24,7 @@ to match your project’s Scala binary version):
<dependency>
<groupId>org.scala-lang.modules</groupId>
<artifactId>scala-async_2.12</artifactId>
<version>0.9.7</version>
<version>0.10.0</version>
</dependency>
```

Expand Down
1 change: 0 additions & 1 deletion admin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ env:
script: admin/build.sh

jdk:
- openjdk6
- oraclejdk8

notifications:
Expand Down
9 changes: 3 additions & 6 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,11 @@ import ScalaModulePlugin._
scalaModuleSettings

scalaVersionsByJvm in ThisBuild := {
val v211 = "2.11.12"
val v212 = "2.12.4"
val v212 = "2.12.6"
val v213 = "2.13.0-M3"

Map(
7 -> List(v211 -> false),
8 -> List(v212 -> true, v213 -> true, v211 -> true),
9 -> List(v212 -> false, v213 -> false, v211 -> false))
8 -> List(v212 -> true, v213 -> true),
9 -> List(v212 -> false, v213 -> false))
}

name := "scala-async"
Expand Down
17 changes: 7 additions & 10 deletions src/main/scala/scala/async/internal/TransformUtils.scala
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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()))
}
// =====================================

/**
Expand Down Expand Up @@ -608,4 +605,4 @@ private[async] trait TransformUtils {
}

case object ContainsAwait
case object NoAwait
case object NoAwait
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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}
Expand All @@ -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")
}
}
}
}