From 7d6466a30ae2de7d8d6340a6def3eee05cd5b721 Mon Sep 17 00:00:00 2001 From: Nicolas Stucki Date: Wed, 31 Jul 2019 11:17:44 +0200 Subject: [PATCH 1/2] Fix #6972: Parially revert c53f465524597bad481f4930eaeaae8ae953e1a7 --- .drone.yml | 8 ++++---- .../src/dotty/tools/dotc/config/JavaPlatform.scala | 11 ++++------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/.drone.yml b/.drone.yml index afe3fc6bfcf3..60296a3da2f1 100644 --- a/.drone.yml +++ b/.drone.yml @@ -59,10 +59,10 @@ steps: commands: - cp -R . /tmp/4/ && cd /tmp/4/ - ./project/scripts/sbt sbt-dotty/scripted - when: - event: - - tag - - promote + # when: + # event: + # - tag + # - promote - name: test_java11 pull: default diff --git a/compiler/src/dotty/tools/dotc/config/JavaPlatform.scala b/compiler/src/dotty/tools/dotc/config/JavaPlatform.scala index 32f73dbd699a..2005a2add3b2 100644 --- a/compiler/src/dotty/tools/dotc/config/JavaPlatform.scala +++ b/compiler/src/dotty/tools/dotc/config/JavaPlatform.scala @@ -22,13 +22,10 @@ class JavaPlatform extends Platform { // The given symbol is a method with the right name and signature to be a runnable java program. def isMainMethod(sym: SymDenotation)(implicit ctx: Context): Boolean = - sym.name == nme.main && - (sym.owner.is(Module) || sym.owner.isClass && !sym.owner.is(Trait) && sym.is(JavaStatic)) && { - sym.info match { - case MethodTpe(_, defn.ArrayOf(el) :: Nil, restpe) => el =:= defn.StringType && (restpe isRef defn.UnitClass) - case _ => false - } - } + (sym.name == nme.main) && (sym.info match { + case MethodTpe(_, defn.ArrayOf(el) :: Nil, restpe) => el =:= defn.StringType && (restpe isRef defn.UnitClass) + case _ => false + }) /** Update classpath with a substituted subentry */ def updateClassPath(subst: Map[ClassPath, ClassPath]): Unit = currentClassPath.get match { From 0d2400dd0fd7e82ffc3936bb7b35de0f7b37fcd8 Mon Sep 17 00:00:00 2001 From: Nicolas Stucki Date: Wed, 31 Jul 2019 11:25:15 +0200 Subject: [PATCH 2/2] Add filter back to `test_sbt` --- .drone.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.drone.yml b/.drone.yml index 60296a3da2f1..afe3fc6bfcf3 100644 --- a/.drone.yml +++ b/.drone.yml @@ -59,10 +59,10 @@ steps: commands: - cp -R . /tmp/4/ && cd /tmp/4/ - ./project/scripts/sbt sbt-dotty/scripted - # when: - # event: - # - tag - # - promote + when: + event: + - tag + - promote - name: test_java11 pull: default