Upload test for #298

This commit is contained in:
Daniel Holle 2024-03-19 15:19:57 +01:00
parent 518f58e08f
commit 1f74345324
2 changed files with 26 additions and 0 deletions

View File

@ -0,0 +1,19 @@
import java.util.List;
import java.util.ArrayList;
import java.lang.Integer;
import java.lang.System;
import java.io.PrintStream;
import java.util.stream.Stream;
import java.util.function.Function;
public class Bug298 {
public <R, T> Stream<R> takes(Stream<T> s, Function<? super T, ? super R> fun) {
return null;
}
public void m() {
List<Integer> list = new ArrayList<>();
Stream<Integer> a = list.stream();
takes(a, x -> 2 * x);
}
}

View File

@ -965,4 +965,11 @@ public class TestComplete {
var instance = clazz.getDeclaredConstructor().newInstance();
clazz.getDeclaredMethod("exec").invoke(instance);
}
@Test
public void testBug298() throws Exception {
var classFiles = generateClassFiles(new ByteArrayClassLoader(), "Bug298.jav");
var clazz = classFiles.get("Bug298");
var instance = clazz.getDeclaredConstructor().newInstance();
}
}