File tree Expand file tree Collapse file tree 1 file changed +3
-17
lines changed
src/test/scala/scala/async Expand file tree Collapse file tree 1 file changed +3
-17
lines changed Original file line number Diff line number Diff line change @@ -44,26 +44,12 @@ package object async {
44
44
45
45
import scala .tools .nsc ._ , reporters ._
46
46
def mkGlobal (compileOptions : String = " " ): Global = {
47
- val source = """
48
- | class Test {
49
- | def test = {
50
- | import scala.async.Async._, scala.concurrent._, ExecutionContext.Implicits.global
51
- | async {
52
- | val opt = await(async(Option.empty[String => Future[Unit]]))
53
- | opt match {
54
- | case None =>
55
- | throw new RuntimeException("case a")
56
- | case Some(f) =>
57
- | await(f("case b"))
58
- | }
59
- | }
60
- | }
61
- | }
62
- | """ .stripMargin
63
47
val settings = new Settings ()
64
48
settings.processArgumentString(compileOptions)
65
- settings.usejavacp .value = true
49
+ val initClassPath = settings.classpath .value
66
50
settings.embeddedDefaults(getClass.getClassLoader)
51
+ if (initClassPath == settings.classpath.value)
52
+ settings.usejavacp.value = true // not running under SBT, try to use the Java claspath instead
67
53
val reporter = new StoreReporter
68
54
new Global (settings, reporter)
69
55
}
You can’t perform that action at this time.
0 commit comments