File tree Expand file tree Collapse file tree
compiler/test/dotty/tools Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -506,7 +506,6 @@ jobs:
506506 || (
507507 github.event_name == 'pull_request'
508508 && !contains(github.event.pull_request.body, '[skip ci]')
509- && contains(github.event.pull_request.body, '[test_java8]')
510509 )
511510 || (
512511 github.event_name == 'workflow_dispatch'
Original file line number Diff line number Diff line change @@ -15,10 +15,13 @@ import org.junit.Test
1515import scala .jdk .CollectionConverters ._
1616import scala .util .Properties
1717
18+ import org .junit .Assume .assumeTrue
19+
1820class MultiReleaseJarTest extends dotty.tools.backend.jvm.DottyBytecodeTest {
1921
2022 @ Test
2123 def mrJar (): Unit = {
24+ assumeTrue(" Multi-release JARs require JDK 9+" , Properties .isJavaAtLeast(" 9" ))
2225
2326 // The test fails if the same jar file gets reused. This might be a caching problem in our classpath implementation
2427
@@ -70,6 +73,7 @@ class MultiReleaseJarTest extends dotty.tools.backend.jvm.DottyBytecodeTest {
7073
7174 @ Test
7275 def ctSymTest (): Unit = {
76+ assumeTrue(" ct.sym cross-compilation requires JDK 9+" , Properties .isJavaAtLeast(" 9" ))
7377
7478 def classExists (className : String , release : String ): Boolean = {
7579 given ctx : Context = initCtx.fresh
Original file line number Diff line number Diff line change @@ -44,14 +44,11 @@ class ZipArchiveTest {
4444 }
4545 }
4646
47- private val bootClassLoader : ClassLoader = {
48- ClassLoader .getPlatformClassLoader
49- }
50-
5147 private def classLoader (location : URI ): ClassLoader =
52- new URLClassLoader (Array (location.toURL), bootClassLoader )
48+ new URLClassLoader (Array (location.toURL), /* parent */ null )
5349
54- private def manifestAt (location : URI ): URL = classLoader(location).getResource(" META-INF/MANIFEST.MF" )
50+ private def manifestAt (location : URI ): URL =
51+ classLoader(location).getResource(" META-INF/MANIFEST.MF" )
5552
5653
5754 // ZipArchive.fromManifestURL(URL)
Original file line number Diff line number Diff line change 55 | Required: Int
66 |
77 | longer explanation available when compiling with `-explain`
8- -- [E007] Type Mismatch Error: tests/neg/i24711-java-nested-types.scala:4:38 -------------------------------------------
9- 4 | val test2: Int = java.util.Map.entry("key", 1 ) // error
10- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
11- | Found: java.util.Map.Entry[String, Int]
12- | Required: Int
8+ -- [E007] Type Mismatch Error: tests/neg/i24711-java-nested-types.scala:4:20 -------------------------------------------
9+ 4 | val test2: Int = (??? : java.util.Map.Entry[String, Int] ) // error
10+ | ^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
11+ | Found: java.util.Map.Entry[String, Int]
12+ | Required: Int
1313 |
1414 | longer explanation available when compiling with `-explain`
1515-- [E007] Type Mismatch Error: tests/neg/i24711-java-nested-types.scala:7:20 -------------------------------------------
Original file line number Diff line number Diff line change 11class Test {
22 val test1 : Int = (??? : java.util.Map .Entry [String , Int ]) // error
33
4- val test2 : Int = java.util.Map .entry( " key " , 1 ) // error
4+ val test2 : Int = ( ??? : java.util.Map .Entry [ String , Int ] ) // error
55
66 trait Outer { type Inner }
77 val test4 : Int = (??? : Outer # Inner ) // error
Original file line number Diff line number Diff line change 1- @ Deprecated (since = Bar .bar()) class Foo
1+ @ SuppressWarnings ( Array ( Bar .bar() )) class Foo
Original file line number Diff line number Diff line change @@ -7,11 +7,11 @@ package logadapter:
77 trait AbstractApi [T <: AbstractLogAdapter ]:
88 def logAdapterFor (loggerName : String ): T
99 trait SelfLogging :
10- given adapter : T = logAdapterFor(this .getClass.getName )
10+ given adapter : T = logAdapterFor(" TestLogger " )
1111 // workaround:
12- // given () => T = logAdapterFor(this.getClass.getName )
12+ // given () => T = logAdapterFor("TestLogger" )
1313 // or
14- // private val adapter = logAdapterFor(this.getClass.getName )
14+ // private val adapter = logAdapterFor("TestLogger" )
1515 // given T = adapter
1616 // or just pollute the interface so it's never taken as pure
1717 // private val z = 42
Original file line number Diff line number Diff line change 11public boolean java.lang.Object.equals(java.lang.Object)
22public final native java.lang.Class<?> java.lang.Object.getClass()
3- public native int java.lang.Object.hashCode()
4- public int Foo.hello()
53public final native void java.lang.Object.notify()
64public final native void java.lang.Object.notifyAll()
7- public java.lang.String java.lang.Object.toString()
8- public final void java.lang.Object.wait(long,int) throws java.lang.InterruptedException
9- public final void java.lang.Object.wait() throws java.lang.InterruptedException
105public final native void java.lang.Object.wait(long) throws java.lang.InterruptedException
6+ public final void java.lang.Object.wait() throws java.lang.InterruptedException
7+ public final void java.lang.Object.wait(long,int) throws java.lang.InterruptedException
8+ public int Foo.hello()
119public int Foo.x()
10+ public java.lang.String java.lang.Object.toString()
11+ public native int java.lang.Object.hashCode()
Original file line number Diff line number Diff line change @@ -4,5 +4,5 @@ class Foo:
44 val x : hello.type = ???
55
66@ main def Test =
7- val mtds = classOf [Foo ].getMethods().sortBy(_.getName ())
7+ val mtds = classOf [Foo ].getMethods().sortBy(_.toGenericString ())
88 for mtd <- mtds do println(mtd.toGenericString())
You can’t perform that action at this time.
0 commit comments