Skip to content

Commit 85b48de

Browse files
committed
Merge pull request scala#483 from dotty-staging/fix-java8-alt
Fix jvm8 lamba related issues.
2 parents ad5b08c + 42b541a commit 85b48de

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

bin/dotc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# Configuration
77
SCALA_VERSION=2.11.5
88
SCALA_BINARY_VERSION=2.11
9-
SCALA_COMPILER_VERSION=2.11.5-20150402-193021-0c75410da3
9+
SCALA_COMPILER_VERSION=2.11.5-20150416-144435-09c4a520e1
1010
DOTTY_VERSION=0.1
1111
JLINE_VERSION=2.12
1212
bootcp=true
@@ -57,13 +57,13 @@ checkjar $TEST_JAR test:package
5757

5858
# Autodetecting the scala-library location, in case it wasn't provided by an environment variable
5959
if [ "$SCALA_LIBRARY_JAR" == "" ]
60-
then
60+
then
6161
SCALA_LIBRARY_JAR=$HOME/.ivy2/cache/org.scala-lang/scala-library/jars/scala-library-$SCALA_VERSION.jar
6262
# this is location where sbt stores it in ivy cache
6363
fi
6464
# save as for scala-library now for scala-reflect
6565
if [ "$SCALA_REFLECT_JAR" == "" ]
66-
then
66+
then
6767
SCALA_REFLECT_JAR=$HOME/.ivy2/cache/org.scala-lang/scala-reflect/jars/scala-reflect-$SCALA_VERSION.jar
6868
fi
6969
if [ "$SCALA_COMPILER_JAR" == "" ]
@@ -72,13 +72,13 @@ then
7272
fi
7373

7474
if [ "$JLINE_JAR" == "" ]
75-
then
75+
then
7676
JLINE_JAR=$HOME/.ivy2//cache/jline/jline/jars/jline-$JLINE_VERSION.jar
7777
fi
7878

7979
if [ ! -f "$SCALA_LIBRARY_JAR" -o ! -f "$SCALA_REFLECT_JAR" -o ! -f "$SCALA_COMPILER_JAR" -o ! -f "$JLINE_JAR" ]
8080
then
81-
echo To use this script please set
81+
echo To use this script please set
8282
echo SCALA_LIBRARY_JAR to point to scala-library-$SCALA_VERSION.jar "(currently $SCALA_LIBRARY_JAR)"
8383
echo SCALA_REFLECT_JAR to point to scala-reflect-$SCALA_VERSION.jar "(currently $SCALA_REFLECT_JAR)"
8484
echo SCALA_COMPILER_JAR to point to scala-compiler-$SCALA_VERSION.jar with bcode patches "(currently $SCALA_COMPILER_JAR)"

project/Build.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ object DottyBuild extends Build {
3131
// get reflect and xml onboard
3232
libraryDependencies ++= Seq("org.scala-lang" % "scala-reflect" % scalaVersion.value,
3333
"org.scala-lang.modules" %% "scala-xml" % "1.0.1",
34-
"me.d-d" % "scala-compiler" % "2.11.5-20150402-193021-0c75410da3",
34+
"me.d-d" % "scala-compiler" % "2.11.5-20150416-144435-09c4a520e1",
3535
"jline" % "jline" % "2.12"),
3636

3737
// get junit onboard

src/dotty/tools/backend/jvm/DottyBackendInterface.scala

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,10 @@ class DottyBackendInterface()(implicit ctx: Context) extends BackendInterface{
103103
val BoxesRunTimeModule = ctx.requiredModule("scala.runtime.BoxesRunTime")
104104
val BoxesRunTimeClass = toDenot(BoxesRunTimeModule).moduleClass.asClass
105105

106+
// require LambdaMetafactory: scalac uses getClassIfDefined, but we need those always.
107+
override lazy val LambdaMetaFactory = ctx.requiredClass("java.lang.invoke.LambdaMetafactory")
108+
override lazy val MethodHandle = ctx.requiredClass("java.lang.invoke.MethodHandle")
109+
106110
val nme_valueOf: Name = StdNames.nme.valueOf
107111
val nme_apply = StdNames.nme.apply
108112
val NothingClass: Symbol = defn.NothingClass
@@ -423,7 +427,7 @@ class DottyBackendInterface()(implicit ctx: Context) extends BackendInterface{
423427
case TermRef(prefix: ThisType, name) =>
424428
Some(tpd.This(prefix.cls).select(i.symbol))
425429
case TermRef(NoPrefix, name) =>
426-
if (i.symbol is Flags.Method) Some(This(i.symbol.enclosingClass).select(i.symbol)) // workaround #342 todo: remove after fixed
430+
if (i.symbol is Flags.Method) Some(This(i.symbol.topLevelClass).select(i.symbol)) // workaround #342 todo: remove after fixed
427431
else None
428432
case _ => None
429433
}

0 commit comments

Comments
 (0)