From b719e0d85a3d008f4755d43e5ec2d702498f12a0 Mon Sep 17 00:00:00 2001 From: AliveDevil Date: Tue, 23 Jul 2024 17:42:45 +0200 Subject: [PATCH] Add failing test --- .../java/lang/invoke/MethodHandleTests.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/IKVM.Java.Tests/java/lang/invoke/MethodHandleTests.java b/src/IKVM.Java.Tests/java/lang/invoke/MethodHandleTests.java index 1a74e96b27..77b93ea918 100644 --- a/src/IKVM.Java.Tests/java/lang/invoke/MethodHandleTests.java +++ b/src/IKVM.Java.Tests/java/lang/invoke/MethodHandleTests.java @@ -3,6 +3,7 @@ import java.lang.*; import java.lang.invoke.*; import java.util.*; +import java.util.function.*; @cli.Microsoft.VisualStudio.TestTools.UnitTesting.TestClassAttribute.Annotation() public class MethodHandleTests { @@ -90,4 +91,19 @@ public void canInvokeStaticMethodThatReturnsVoid() throws Throwable { }; } + @cli.Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute.Annotation() + public void canInvokeThroughSupplier() throws Throwable { // Issue #509 + Class effectiveAnchor = MethodHandleTests.class; + final Supplier supplier = new Supplier() { + private final Supplier supplier = effectiveAnchor::getClassLoader; + + @Override + public ClassLoader get() { + return supplier.get(); + } + }; + + final ClassLoader classLoader = supplier.get(); + } + }