Skip to content

Commit 9becf4f

Browse files
committed
compile with locally built scala-virtualized 2.11
all tests pass here, but scala-virtualized has a few failing ones related to pattern matching
1 parent 2b3f2a3 commit 9becf4f

File tree

7 files changed

+21
-11
lines changed

7 files changed

+21
-11
lines changed

build.sbt

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,16 @@ version := "0.3-SNAPSHOT"
44

55
organization := "EPFL"
66

7-
scalaOrganization := "org.scala-lang.virtualized"
7+
scalaOrganization := "org.scala-lang" // "org.scala-lang.virtualized"
88

99
scalaVersion := virtScala
1010

11+
// BRING YOUR OWN SCALAC:
12+
// this should point to a scala compiler built from this repo/branch:
13+
// https://github.com/TiarkRompf/scala/tree/topic-virt-2.11.2
14+
15+
scalaHome := Some(file("/Users/me/scala/build/pack/"))
16+
1117
scalaSource in Compile <<= baseDirectory(_ / "src")
1218

1319
scalaSource in Test <<= baseDirectory(_ / "test-src")
@@ -19,9 +25,12 @@ scalacOptions += "-Yvirtualize"
1925
//scalacOptions in Compile ++= Seq(/*Unchecked, */Deprecation)
2026

2127

22-
libraryDependencies += "org.scala-lang.virtualized" % "scala-library" % virtScala
28+
libraryDependencies += "org.scala-lang" % "scala-library" % virtScala
29+
30+
libraryDependencies += "org.scala-lang" % "scala-compiler" % virtScala
31+
32+
libraryDependencies += "org.scala-lang.plugins" % "scala-continuations-library_2.11" % "1.0.2"
2333

24-
libraryDependencies += "org.scala-lang.virtualized" % "scala-compiler" % virtScala
2534

2635
libraryDependencies += scalaTest
2736

@@ -36,6 +45,6 @@ publishArtifact in (Compile, packageDoc) := false
3645
// continuations
3746
autoCompilerPlugins := true
3847

39-
addCompilerPlugin("org.scala-lang.virtualized.plugins" % "continuations" % virtScala)
48+
addCompilerPlugin("org.scala-lang.plugins" % "scala-continuations-plugin_2.11.2" % "1.0.2")
4049

4150
scalacOptions += "-P:continuations:enable"

project/Build.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import java.io.File
44
object LMSBuild extends Build {
55
System.setProperty("showSuppressedErrors", "false")
66

7-
val scalaTest = "org.scalatest" % "scalatest_2.10" % "2.1.2"
7+
val scalaTest = "org.scalatest" % "scalatest_2.11" % "2.2.2"
88

9-
val virtScala = Option(System.getenv("SCALA_VIRTUALIZED_VERSION")).getOrElse("2.10.2")
9+
val virtScala = Option(System.getenv("SCALA_VIRTUALIZED_VERSION")).getOrElse("2.11.2")
1010

1111
lazy val lms = Project("LMS", file("."))
1212
}

src/common/Structs.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ trait StructTags {
3131
case class ClassTag[T](name: String) extends StructTag[T]
3232
case class NestClassTag[C[_],T](elem: StructTag[T]) extends StructTag[C[T]]
3333
case class AnonTag[T](fields: RefinedManifest[T]) extends StructTag[T]
34-
case class MapTag[T] extends StructTag[T]
34+
case class MapTag[T]() extends StructTag[T]
3535
}
3636

3737
trait StructExp extends StructOps with StructTags with BaseExp with EffectExp with VariablesExp with ObjectOpsExp with StringOpsExp with OverloadHack {

test-out/epfl/test14-queries3.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ x2551
6161
End of Generated Code
6262
*******************************************/
6363

64-
warning: there were 9 feature warning(s); re-run with -feature for details
64+
warning: there were 9 feature warnings; re-run with -feature for details
6565
one warning found
6666
compilation: ok
6767
expertise("abstract"):

test-out/epfl/test14-queries4.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ x2551
6161
End of Generated Code
6262
*******************************************/
6363

64-
warning: there were 9 feature warning(s); re-run with -feature for details
64+
warning: there were 9 feature warnings; re-run with -feature for details
6565
one warning found
6666
compilation: ok
6767
expertise2("abstract"):

test-src/epfl/test12-collections/TestList.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class TestList extends FileDiffSuite {
2222
xs ++ List(unit(1), unit(2), unit(3))
2323

2424
def emptyLeft(xs: Rep[List[Int]]): Rep[List[Int]] =
25-
List() ++ xs
25+
List[Int]() ++ xs // VIRT 2.11: need type annotation
2626

2727
def emptyRight(xs: Rep[List[Int]]): Rep[List[Int]] =
2828
xs ++ List()

test-src/epfl/test14-scratch/TestQueries.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,8 @@ trait StagedExp extends Staged with ScalaOpsPkgExp with BooleanOpsExpOpt with St
799799
*/
800800
case (Empty(),Empty()) => List()
801801
case (IfThen(c,a),Empty()) => if (cond && c) a else List()
802-
case (For(l,f),Empty()) => for (x <- l if cond; y <- f(x)) yield y
802+
case (For(l,f),Empty()) => implicit def unsafe[T] = manifest[Any].asInstanceOf[Manifest[T]] // FIXME: get manifest (for result type) from somewhere else
803+
for (x <- l if cond; y <- f(x)) yield y
803804
case (Concat(a,b),Empty()) => (if (cond) a else List()) ++ (if (cond) b else List())
804805
case _ => super.ifThenElse(cond,thenp,elsep)
805806
}).asInstanceOf[Exp[T]]

0 commit comments

Comments
 (0)