Skip to content

Fix main #16394

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 22, 2022
Merged

Fix main #16394

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions tests/run/i11332.scala
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ object Test:
val mhOverI = l.findVirtual(classOf[Foo], "over", methodType(classOf[String], classOf[Int]))
val mhUnit = l.findVirtual(classOf[Foo], "unit", methodType(classOf[Unit], classOf[String]))
val mhObj = l.findVirtual(classOf[Foo], "obj", methodType(classOf[Any], classOf[String]))
val mhCL = l.findStatic(classOf[ClassLoader], "getPlatformClassLoader", methodType(classOf[ClassLoader]))

assert(-42 == (mhNeg.invokeExact(self, 42): Int))
assert(-33 == (mhNeg.invokeExact(self, 33): Int))
Expand All @@ -47,10 +46,12 @@ object Test:
def any3 = mhObj.invokeExact(self, "any3")
assert("any3" == any3)

assert(null != (mhCL.invoke(): ClassLoader))
assert(null != (mhCL.invoke().asInstanceOf[ClassLoader]: ClassLoader))
assert(null != (mhCL.invokeExact(): ClassLoader))
assert(null != (mhCL.invokeExact().asInstanceOf[ClassLoader]: ClassLoader))
// Needs JDK 9+
// val mhCL = l.findStatic(classOf[ClassLoader], "getPlatformClassLoader", methodType(classOf[ClassLoader]))
// assert(null != (mhCL.invoke(): ClassLoader))
// assert(null != (mhCL.invoke().asInstanceOf[ClassLoader]: ClassLoader))
// assert(null != (mhCL.invokeExact(): ClassLoader))
// assert(null != (mhCL.invokeExact().asInstanceOf[ClassLoader]: ClassLoader))

expectWrongMethod {
l // explicit chain method call
Expand Down