From e882335ba4ad1ba2aca9c1bb9bb883a6e553ccda Mon Sep 17 00:00:00 2001 From: Dmitry Petrashko Date: Thu, 22 Oct 2015 12:16:02 +0200 Subject: [PATCH 1/6] Fix DottyBackendInterafec.isStaticModuleClass. Used to pass wrong context. --- src/dotty/tools/backend/jvm/DottyBackendInterface.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dotty/tools/backend/jvm/DottyBackendInterface.scala b/src/dotty/tools/backend/jvm/DottyBackendInterface.scala index 916ab32981a7..f92abe9060ef 100644 --- a/src/dotty/tools/backend/jvm/DottyBackendInterface.scala +++ b/src/dotty/tools/backend/jvm/DottyBackendInterface.scala @@ -640,7 +640,7 @@ class DottyBackendInterface()(implicit ctx: Context) extends BackendInterface{ val original = toDenot(sym).initial val validity = original.validFor val shiftedContext = ctx.withPhase(validity.phaseId) - toDenot(sym)(shiftedContext).isStatic + toDenot(sym)(shiftedContext).isStatic(shiftedContext) } def isStaticConstructor: Boolean = isStaticMember && isClassConstructor From 3485e8eedf770ace5c68847ab6c19e9960e763b5 Mon Sep 17 00:00:00 2001 From: Dmitry Petrashko Date: Thu, 22 Oct 2015 12:16:50 +0200 Subject: [PATCH 2/6] Update version of bundled backend. --- project/Build.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/Build.scala b/project/Build.scala index cc8fbfb698fc..be39358ff582 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -42,7 +42,7 @@ object DottyBuild extends Build { resolvers += Resolver.sonatypeRepo("releases"), // get libraries onboard - partestDeps := Seq("me.d-d" % "scala-compiler" % "2.11.5-20150714-145300-2ad68448c5", + partestDeps := Seq("me.d-d" % "scala-compiler" % "2.11.5-20151022-113908-7fb0e653fd", "org.scala-lang" % "scala-reflect" % scalaVersion.value, "org.scala-lang" % "scala-library" % scalaVersion.value % "test"), libraryDependencies ++= partestDeps.value, From 1adc563d6e4187675c97aa036c0227dc2ff10edf Mon Sep 17 00:00:00 2001 From: Dmitry Petrashko Date: Thu, 22 Oct 2015 14:05:19 +0200 Subject: [PATCH 3/6] Fix bug in dotc script. Used to always use bootstrapped version --- bin/dotc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/dotc b/bin/dotc index aa8a9e44a241..7b90b5220425 100755 --- a/bin/dotc +++ b/bin/dotc @@ -192,7 +192,7 @@ trap onExit INT # If using the boot classpath, also pass an empty classpath # to java to suppress "." from materializing. classpathArgs () { - if [[ -n $bootstrapped ]]; then + if [[ "true" == $bootstrapped ]]; then checkjar $DOTTY_JAR "test:runMain dotc.build" src toolchain="$DOTTY_JAR:$SCALA_LIBRARY_JAR:$SCALA_REFLECT_JAR:$SCALA_COMPILER_JAR:$JLINE_JAR" else From 4dd12e6ea12b1b2a0ef5af82f5474167a4d2c6db Mon Sep 17 00:00:00 2001 From: Dmitry Petrashko Date: Thu, 22 Oct 2015 18:19:15 +0200 Subject: [PATCH 4/6] Workaround #840 --- src/dotty/tools/dotc/transform/TypeTestsCasts.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dotty/tools/dotc/transform/TypeTestsCasts.scala b/src/dotty/tools/dotc/transform/TypeTestsCasts.scala index 4ce64da33dd0..9f6bd4c0f043 100644 --- a/src/dotty/tools/dotc/transform/TypeTestsCasts.scala +++ b/src/dotty/tools/dotc/transform/TypeTestsCasts.scala @@ -47,7 +47,7 @@ trait TypeTestsCasts { def transformIsInstanceOf(expr:Tree, argType: Type): Tree = { def argCls = argType.classSymbol - if (expr.tpe <:< argType) + if (false && expr.tpe <:< argType) Literal(Constant(true)) withPos tree.pos else if (argCls.isPrimitiveValueClass) if (qualCls.isPrimitiveValueClass) Literal(Constant(qualCls == argCls)) withPos tree.pos From 3217d74cf15e38f04330f82cd44afbc608fc342e Mon Sep 17 00:00:00 2001 From: Dmitry Petrashko Date: Thu, 22 Oct 2015 18:20:28 +0200 Subject: [PATCH 5/6] Run partest under bootstrapped dotty. --- project/Build.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/project/Build.scala b/project/Build.scala index be39358ff582..442ac3c2f4ff 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -81,7 +81,7 @@ object DottyBuild extends Build { val args = Def.spaceDelimited("").parsed val jars = Seq((packageBin in Compile).value.getAbsolutePath) ++ getJarPaths(partestDeps.value, ivyPaths.value.ivyHome) - val dottyJars = "-dottyJars " + jars.length + " " + jars.mkString(" ") + val dottyJars = "-dottyJars " + (jars.length + 1) + " dotty.jar" + " " + jars.mkString(" ") // Provide the jars required on the classpath of run tests runTask(Test, "dotty.partest.DPConsoleRunner", dottyJars + " " + args.mkString(" ")) }, @@ -118,8 +118,8 @@ object DottyBuild extends Build { ("-DpartestParentID=" + pid) :: tuning ::: agentOptions ::: travis_build ::: fullpath } - ) ++ addCommandAlias("partest", ";test:package;package;lockPartestFile;test:test;runPartestRunner") ++ - addCommandAlias("partest-only", ";test:package;package;lockPartestFile;test:test-only dotc.tests;runPartestRunner") + ) ++ addCommandAlias("partest", ";test:package;package;test:runMain dotc.build;lockPartestFile;test:test;runPartestRunner") ++ + addCommandAlias("partest-only", ";test:package;package;test:runMain dotc.build;lockPartestFile;test:test-only dotc.tests;runPartestRunner") lazy val dotty = Project(id = "dotty", base = file("."), settings = defaults) From 4959eab99c3b50830d0d67cf22ce921bf62035bd Mon Sep 17 00:00:00 2001 From: Dmitry Petrashko Date: Thu, 22 Oct 2015 18:27:52 +0200 Subject: [PATCH 6/6] Enable running pos tests in partest As junit tests are run with dotty-compiled-by-scalac, it makes sense to execute run tests with dotty-compiled-by-dotty. --- scripts/jobs/validate/partest | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/jobs/validate/partest b/scripts/jobs/validate/partest index ee45a39199e4..55ec9f4c1c94 100755 --- a/scripts/jobs/validate/partest +++ b/scripts/jobs/validate/partest @@ -4,5 +4,5 @@ baseDir=${WORKSPACE-`pwd`} scriptsDir="$baseDir/scripts" . $scriptsDir/common -sbt $sbtArgs update compile "partest-only run --show-diff --verbose" +sbt $sbtArgs update compile "partest-only --show-diff --verbose"