diff options
24 files changed, 67 insertions, 55 deletions
diff --git a/src/eclipse/partest/.classpath b/src/eclipse/partest/.classpath index 74eb47032d..f21d653e63 100644 --- a/src/eclipse/partest/.classpath +++ b/src/eclipse/partest/.classpath @@ -9,6 +9,6 @@ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry combineaccessrules="false" kind="src" path="/scala-compiler"/> <classpathentry combineaccessrules="false" kind="src" path="/scala-library"/> - <classpathentry kind="var" path="SCALA_BASEDIR/build/deps/partest/scala-partest_2.12.0-M5-1.0.17.jar"/> + <classpathentry kind="var" path="SCALA_BASEDIR/build/deps/partest/scala-partest_2.12.0-M5-1.1.0.jar"/> <classpathentry kind="output" path="build-quick-partest-extras"/> </classpath> diff --git a/src/eclipse/scaladoc/.classpath b/src/eclipse/scaladoc/.classpath index 9ae1a1c1dd..14dd2e665e 100644 --- a/src/eclipse/scaladoc/.classpath +++ b/src/eclipse/scaladoc/.classpath @@ -7,6 +7,6 @@ <classpathentry combineaccessrules="false" kind="src" path="/scala-compiler"/> <classpathentry combineaccessrules="false" kind="src" path="/scala-library"/> <classpathentry kind="var" path="SCALA_BASEDIR/build/deps/scaladoc/scala-xml_2.12.0-M5-1.0.5.jar"/> - <classpathentry kind="var" path="SCALA_BASEDIR/build/deps/partest/scala-partest_2.12.0-M5-1.0.17.jar"/> + <classpathentry kind="var" path="SCALA_BASEDIR/build/deps/partest/scala-partest_2.12.0-M5-1.1.0.jar"/> <classpathentry kind="output" path="build-quick-scaladoc"/> </classpath> diff --git a/src/intellij/scala.ipr.SAMPLE b/src/intellij/scala.ipr.SAMPLE index 0ffcf89dd5..10a07335fa 100644 --- a/src/intellij/scala.ipr.SAMPLE +++ b/src/intellij/scala.ipr.SAMPLE @@ -98,7 +98,7 @@ <root url="jar://$USER_HOME$/.ivy2/cache/org.scala-lang.modules/scala-asm/bundles/scala-asm-5.1.0-scala-1.jar!/" /> <root url="jar://$USER_HOME$/.ivy2/cache/org.scala-lang.modules/scala-xml_2.12.0-M5/bundles/scala-xml_2.12.0-M5-1.0.5.jar!/" /> <root url="jar://$USER_HOME$/.ivy2/cache/jline/jline/jars/jline-2.14.3.jar!/" /> - <root url="jar://$USER_HOME$/.ivy2/cache/org.scala-lang.modules/scala-partest_2.12.0-M5/jars/scala-partest_2.12.0-M5-1.0.17.jar!/" /> + <root url="jar://$USER_HOME$/.ivy2/cache/org.scala-lang.modules/scala-partest_2.12.0-M5/jars/scala-partest_2.12.0-M5-1.1.0.jar!/" /> <root url="jar://$USER_HOME$/.ivy2/cache/com.googlecode.java-diff-utils/diffutils/jars/diffutils-1.3.0.jar!/" /> <root url="jar://$USER_HOME$/.ivy2/cache/org.scala-sbt/test-interface/jars/test-interface-1.0.jar!/" /> <root url="jar://$USER_HOME$/.ivy2/cache/junit/junit/jars/junit-4.12.jar!/" /> @@ -123,7 +123,7 @@ <root url="jar://$USER_HOME$/.ivy2/cache/org.scala-lang.modules/scala-asm/bundles/scala-asm-5.1.0-scala-1.jar!/" /> <root url="jar://$USER_HOME$/.ivy2/cache/org.scala-lang.modules/scala-xml_2.12.0-M5/bundles/scala-xml_2.12.0-M5-1.0.5.jar!/" /> <root url="jar://$USER_HOME$/.ivy2/cache/jline/jline/jars/jline-2.14.3.jar!/" /> - <root url="jar://$USER_HOME$/.ivy2/cache/org.scala-lang.modules/scala-partest_2.12.0-M5/jars/scala-partest_2.12.0-M5-1.0.17.jar!/" /> + <root url="jar://$USER_HOME$/.ivy2/cache/org.scala-lang.modules/scala-partest_2.12.0-M5/jars/scala-partest_2.12.0-M5-1.1.0.jar!/" /> <root url="jar://$USER_HOME$/.ivy2/cache/com.googlecode.java-diff-utils/diffutils/jars/diffutils-1.3.0.jar!/" /> <root url="jar://$USER_HOME$/.ivy2/cache/org.scala-sbt/test-interface/jars/test-interface-1.0.jar!/" /> </CLASSES> @@ -255,7 +255,7 @@ <root url="jar://$USER_HOME$/.ivy2/cache/org.apache.ant/ant-launcher/jars/ant-launcher-1.9.4.jar!/" /> <root url="jar://$USER_HOME$/.ivy2/cache/org.scala-lang.modules/scala-asm/bundles/scala-asm-5.1.0-scala-1.jar!/" /> <root url="jar://$USER_HOME$/.ivy2/cache/org.scala-lang.modules/scala-xml_2.12.0-M5/bundles/scala-xml_2.12.0-M5-1.0.5.jar!/" /> - <root url="jar://$USER_HOME$/.ivy2/cache/org.scala-lang.modules/scala-partest_2.12.0-M5/jars/scala-partest_2.12.0-M5-1.0.17.jar!/" /> + <root url="jar://$USER_HOME$/.ivy2/cache/org.scala-lang.modules/scala-partest_2.12.0-M5/jars/scala-partest_2.12.0-M5-1.1.0.jar!/" /> <root url="jar://$USER_HOME$/.ivy2/cache/com.googlecode.java-diff-utils/diffutils/jars/diffutils-1.3.0.jar!/" /> <root url="jar://$USER_HOME$/.ivy2/cache/org.scala-sbt/test-interface/jars/test-interface-1.0.jar!/" /> </CLASSES> @@ -294,7 +294,7 @@ <root url="jar://$USER_HOME$/.ivy2/cache/org.scala-lang.modules/scala-asm/bundles/scala-asm-5.1.0-scala-1.jar!/" /> <root url="jar://$USER_HOME$/.ivy2/cache/org.scala-lang.modules/scala-xml_2.12.0-M5/bundles/scala-xml_2.12.0-M5-1.0.5.jar!/" /> <root url="jar://$USER_HOME$/.ivy2/cache/jline/jline/jars/jline-2.14.3.jar!/" /> - <root url="jar://$USER_HOME$/.ivy2/cache/org.scala-lang.modules/scala-partest_2.12.0-M5/jars/scala-partest_2.12.0-M5-1.0.17.jar!/" /> + <root url="jar://$USER_HOME$/.ivy2/cache/org.scala-lang.modules/scala-partest_2.12.0-M5/jars/scala-partest_2.12.0-M5-1.1.0.jar!/" /> <root url="jar://$USER_HOME$/.ivy2/cache/com.googlecode.java-diff-utils/diffutils/jars/diffutils-1.3.0.jar!/" /> <root url="jar://$USER_HOME$/.ivy2/cache/org.scala-sbt/test-interface/jars/test-interface-1.0.jar!/" /> </CLASSES> diff --git a/test/files/jvm/t8786/B_2.java b/test/files/jvm/t8786/B_2.java index dc155a290f..ab5350b136 100644 --- a/test/files/jvm/t8786/B_2.java +++ b/test/files/jvm/t8786/B_2.java @@ -5,7 +5,7 @@ public class B_2 { public static void m(String a) { res += 100; } public static void m(Object a) { res += 1000; } - public static <T> T foo(int a, T... b) { return b[0]; } + @SafeVarargs public static <T> T foo(int a, T... b) { return b[0]; } public static <T> T bar(T b[]) { return b[0]; } diff --git a/test/files/jvm/varargs/JavaClass.java b/test/files/jvm/varargs/JavaClass.java index 0cc3587c5e..35adcff850 100644 --- a/test/files/jvm/varargs/JavaClass.java +++ b/test/files/jvm/varargs/JavaClass.java @@ -1,5 +1,5 @@ public class JavaClass { - public static <T> void varargz(int i, T... v) { } + @SafeVarargs public static <T> void varargz(int i, T... v) { } public static void callSomeAnnotations() { VaClass va = new VaClass(); diff --git a/test/files/neg/t7014.check b/test/files/neg/t7014.check index 07ad51e9d3..c68c170835 100644 --- a/test/files/neg/t7014.check +++ b/test/files/neg/t7014.check @@ -1,4 +1,4 @@ -warning: While parsing annotations in t7014-neg.obj/t7014/ThreadSafetyLevel.class, could not find COMPLETELY_THREADSAFE in enum object ThreadSafetyLevel. +warning: While parsing annotations in t7014-neg.obj/t7014/ThreadSafetyLevel_1.class, could not find COMPLETELY_THREADSAFE in enum object ThreadSafetyLevel_1. This is likely due to an implementation restriction: an annotation argument cannot refer to a member of the annotated class (SI-7014). error: No warnings can be incurred under -Xfatal-warnings. one warning found diff --git a/test/files/neg/t7014/ThreadSafetyLevel.java b/test/files/neg/t7014/ThreadSafetyLevel_1.java index 4df1dc787a..eeca65366b 100644 --- a/test/files/neg/t7014/ThreadSafetyLevel.java +++ b/test/files/neg/t7014/ThreadSafetyLevel_1.java @@ -4,5 +4,5 @@ package t7014; // package needed due to other bug in scalac's java parser // and on doing so, fail to find a symbol for the COMPLETELY_THREADSAFE reference // from the annotation's argument to the enum's member // for now, let's just not crash -- should implement lazy completing at some point -@ThreadSafety(level=ThreadSafetyLevel.COMPLETELY_THREADSAFE) -public enum ThreadSafetyLevel { COMPLETELY_THREADSAFE } +@ThreadSafety_1(level=ThreadSafetyLevel_1.COMPLETELY_THREADSAFE) +public enum ThreadSafetyLevel_1 { COMPLETELY_THREADSAFE } diff --git a/test/files/neg/t7014/ThreadSafety.java b/test/files/neg/t7014/ThreadSafety_1.java index ed508804e3..e68b103d1f 100644 --- a/test/files/neg/t7014/ThreadSafety.java +++ b/test/files/neg/t7014/ThreadSafety_1.java @@ -4,6 +4,6 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; @Retention(RetentionPolicy.RUNTIME) // must be exactly RUNTIME retention (those we parse) -public @interface ThreadSafety { - ThreadSafetyLevel level(); +public @interface ThreadSafety_1 { + ThreadSafetyLevel_1 level(); }
\ No newline at end of file diff --git a/test/files/neg/t7014/t7014.scala b/test/files/neg/t7014/t7014.scala deleted file mode 100644 index 7c73f700be..0000000000 --- a/test/files/neg/t7014/t7014.scala +++ /dev/null @@ -1,3 +0,0 @@ -package t7014 - -import ThreadSafetyLevel.COMPLETELY_THREADSAFE // refer to annotation so it gets parsed diff --git a/test/files/neg/t7014/t7014_2.scala b/test/files/neg/t7014/t7014_2.scala new file mode 100644 index 0000000000..4845fc9a5d --- /dev/null +++ b/test/files/neg/t7014/t7014_2.scala @@ -0,0 +1,3 @@ +package t7014 + +import ThreadSafetyLevel_1.COMPLETELY_THREADSAFE // refer to annotation so it gets parsed diff --git a/test/files/run/bcodeInlinerMixed/B_1.scala b/test/files/run/bcodeInlinerMixed/B_1.scala index 2aadeccb82..b26f2f1dd5 100644 --- a/test/files/run/bcodeInlinerMixed/B_1.scala +++ b/test/files/run/bcodeInlinerMixed/B_1.scala @@ -1,15 +1,13 @@ -// Partest does proper mixed compilation: +// Since 1.0.18, partest does mixed compilation only in two stages // 1. scalac *.scala *.java // 2. javac *.java -// 3. scalc *.scala -// -// In the second scalc round, the classfile for A_1 is on the classpath. -// Therefore the inliner has access to the bytecode of `bar`, which means -// it can verify that the invocation to `bar` can be safely inlined. // -// So both callsites of `flop` are inlined. +// Before it used to do a third stage +// 3. scalc *.scala // -// In a single mixed compilation, `flop` cannot be inlined, see JUnit InlinerTest.scala, def mixedCompilationNoInline. +// Because he inliner doesn't has access to the bytecode of `bar`, it cannot verify whether the +// invocation of `bar` can be safely copied to a differnet place, so `flop` is not inlined to `B.g` +// or `C.h`. class B { @inline final def flop = A_1.bar diff --git a/test/files/run/bcodeInlinerMixed/Test.scala b/test/files/run/bcodeInlinerMixed/Test.scala deleted file mode 100644 index c8c7a9fe2a..0000000000 --- a/test/files/run/bcodeInlinerMixed/Test.scala +++ /dev/null @@ -1,16 +0,0 @@ -import scala.tools.partest.{BytecodeTest, ASMConverters} -import ASMConverters._ - -object Test extends BytecodeTest { - def show: Unit = { - val gIns = instructionsFromMethod(getMethod(loadClassNode("B"), "g")) - val hIns = instructionsFromMethod(getMethod(loadClassNode("C"), "h")) - // val invocation = Invoke(INVOKESTATIC, A_1, bar, ()I, false) - for (i <- List(gIns, hIns)) { - assert(i exists { - case Invoke(_, _, "bar", "()I", _) => true - case _ => false - }, i mkString "\n") - } - } -} diff --git a/test/files/run/bcodeInlinerMixed/Test_2.scala b/test/files/run/bcodeInlinerMixed/Test_2.scala new file mode 100644 index 0000000000..db1ea14a8f --- /dev/null +++ b/test/files/run/bcodeInlinerMixed/Test_2.scala @@ -0,0 +1,30 @@ +import scala.tools.partest.{BytecodeTest, ASMConverters} +import ASMConverters._ + +class D { + // This is compiled with `A_1.class` on the classpath. When inlining `flop` (which invokes + // `A_1.bar`), the inliner can check that the call to `A_1.bar` can be safely inlined into a + // different classfile (D). See also comment in B_1.scala. + def m(b: B) = b.flop +} + +object Test extends BytecodeTest { + def show: Unit = { + val gIns = instructionsFromMethod(getMethod(loadClassNode("B"), "g")) + val hIns = instructionsFromMethod(getMethod(loadClassNode("C"), "h")) + for (i <- List(gIns, hIns)) { + assert(i exists { + // `flop` is not inlined + case Invoke(_, _, "flop", "()I", _) => true + case _ => false + }, i mkString "\n") + } + + val mIns = instructionsFromMethod(getMethod(loadClassNode("D"), "m")) + assert(mIns exists { + // `flop` is inlined, we get a call to `bar` + case Invoke(_, _, "bar", "()I", _) => true + case _ => false + }, mIns mkString "\n") + } +} diff --git a/test/files/run/t4788-separate-compilation.check b/test/files/run/t4788-separate-compilation.check index 172ad90102..618fddfea3 100644 --- a/test/files/run/t4788-separate-compilation.check +++ b/test/files/run/t4788-separate-compilation.check @@ -1,5 +1,5 @@ Some(@Ljava/lang/Deprecated;()) None -None -Some(@LCAnnotation;() // invisible) +Some(@LSAnnotation;()) +Some(@LCAnnotation;()) Some(@LRAnnotation;()) diff --git a/test/files/run/t4788.check b/test/files/run/t4788.check index 172ad90102..618fddfea3 100644 --- a/test/files/run/t4788.check +++ b/test/files/run/t4788.check @@ -1,5 +1,5 @@ Some(@Ljava/lang/Deprecated;()) None -None -Some(@LCAnnotation;() // invisible) +Some(@LSAnnotation;()) +Some(@LCAnnotation;()) Some(@LRAnnotation;()) diff --git a/test/files/run/t6240a/StepOne.java b/test/files/run/t6240a/StepOne.java index 342d617c79..a9c076c000 100644 --- a/test/files/run/t6240a/StepOne.java +++ b/test/files/run/t6240a/StepOne.java @@ -31,7 +31,7 @@ public class StepOne { // launch StepTwo URL[] launchURLs = new URL[launchPaths.length]; for (int i = 0; i < launchPaths.length; i++) { - launchURLs[i] = new File(launchPaths[i]).toURL(); + launchURLs[i] = new File(launchPaths[i]).toURI().toURL(); } URLClassLoader classLoader = new URLClassLoader(launchURLs, Object.class.getClassLoader()); Class<?> stepTwo = classLoader.loadClass("StepTwo"); diff --git a/test/files/run/t6240b/StepOne.java b/test/files/run/t6240b/StepOne.java index 342d617c79..a9c076c000 100644 --- a/test/files/run/t6240b/StepOne.java +++ b/test/files/run/t6240b/StepOne.java @@ -31,7 +31,7 @@ public class StepOne { // launch StepTwo URL[] launchURLs = new URL[launchPaths.length]; for (int i = 0; i < launchPaths.length; i++) { - launchURLs[i] = new File(launchPaths[i]).toURL(); + launchURLs[i] = new File(launchPaths[i]).toURI().toURL(); } URLClassLoader classLoader = new URLClassLoader(launchURLs, Object.class.getClassLoader()); Class<?> stepTwo = classLoader.loadClass("StepTwo"); diff --git a/test/files/run/t7582.check b/test/files/run/t7582.check index 58d0f19f5d..d0a0975d4c 100644 --- a/test/files/run/t7582.check +++ b/test/files/run/t7582.check @@ -1,5 +1,5 @@ -InlineHolder.scala:9: warning: p1/InlineHolder$::inlinable()I is annotated @inline but could not be inlined: -The callee p1/InlineHolder$::inlinable()I contains the instruction INVOKESTATIC p1/PackageProtectedJava.protectedMethod ()I +InlineHolder_2.scala:9: warning: p1/InlineHolder$::inlinable()I is annotated @inline but could not be inlined: +The callee p1/InlineHolder$::inlinable()I contains the instruction INVOKESTATIC p1/PackageProtectedJava_1.protectedMethod ()I that would cause an IllegalAccessError when inlined into class O$. def x = p1.InlineHolder.inlinable ^ diff --git a/test/files/run/t7582b/InlineHolder.scala b/test/files/run/t7582/InlineHolder_2.scala index a18b9effaa..44c68d49b9 100644 --- a/test/files/run/t7582b/InlineHolder.scala +++ b/test/files/run/t7582/InlineHolder_2.scala @@ -1,6 +1,6 @@ package p1 { object InlineHolder { - @inline def inlinable = p1.PackageProtectedJava.protectedMethod() + 1 + @inline def inlinable = p1.PackageProtectedJava_1.protectedMethod() + 1 } } diff --git a/test/files/run/t7582/PackageProtectedJava.java b/test/files/run/t7582/PackageProtectedJava_1.java index b7ea2a7676..a3a957dad8 100644 --- a/test/files/run/t7582/PackageProtectedJava.java +++ b/test/files/run/t7582/PackageProtectedJava_1.java @@ -1,6 +1,6 @@ package p1; // public class, protected method -public class PackageProtectedJava { +public class PackageProtectedJava_1 { static final int protectedMethod() { return 1; } } diff --git a/test/files/run/t7582b.check b/test/files/run/t7582b.check index 58d0f19f5d..d0a0975d4c 100644 --- a/test/files/run/t7582b.check +++ b/test/files/run/t7582b.check @@ -1,5 +1,5 @@ -InlineHolder.scala:9: warning: p1/InlineHolder$::inlinable()I is annotated @inline but could not be inlined: -The callee p1/InlineHolder$::inlinable()I contains the instruction INVOKESTATIC p1/PackageProtectedJava.protectedMethod ()I +InlineHolder_2.scala:9: warning: p1/InlineHolder$::inlinable()I is annotated @inline but could not be inlined: +The callee p1/InlineHolder$::inlinable()I contains the instruction INVOKESTATIC p1/PackageProtectedJava_1.protectedMethod ()I that would cause an IllegalAccessError when inlined into class O$. def x = p1.InlineHolder.inlinable ^ diff --git a/test/files/run/t7582/InlineHolder.scala b/test/files/run/t7582b/InlineHolder_2.scala index a18b9effaa..44c68d49b9 100644 --- a/test/files/run/t7582/InlineHolder.scala +++ b/test/files/run/t7582b/InlineHolder_2.scala @@ -1,6 +1,6 @@ package p1 { object InlineHolder { - @inline def inlinable = p1.PackageProtectedJava.protectedMethod() + 1 + @inline def inlinable = p1.PackageProtectedJava_1.protectedMethod() + 1 } } diff --git a/test/files/run/t7582b/PackageProtectedJava.java b/test/files/run/t7582b/PackageProtectedJava_1.java index 55a44b79f9..42a2019b91 100644 --- a/test/files/run/t7582b/PackageProtectedJava.java +++ b/test/files/run/t7582b/PackageProtectedJava_1.java @@ -1,6 +1,6 @@ package p1; // protected class, public method -class PackageProtectedJava { +class PackageProtectedJava_1 { public static final int protectedMethod() { return 1; } } diff --git a/versions.properties b/versions.properties index a7abcba03c..83417bfbd5 100644 --- a/versions.properties +++ b/versions.properties @@ -24,6 +24,6 @@ jline.version=2.14.3 scala-asm.version=5.1.0-scala-1 # external modules, used internally (not shipped) -partest.version.number=1.0.17 +partest.version.number=1.1.0 scalacheck.version.number=1.11.6 |