Compare commits

..
1 Commits
Author SHA1 Message Date
dholle 63a9239d1a Add test case
Build and Test with Maven / Build-and-test-with-Maven (push) Failing after 1m20s
2026-11-18 14:20:48 +01:00
3 changed files with 18 additions and 17 deletions

No files matched your search

+11
View File
@@ -0,0 +1,11 @@
import java.lang.Integer;
import java.lang.String;
public class Bug460 {
public id(x) { return x; } // with "public <T> T id(T x)" it compiles
public run() {
Integer a = id(5);
String b = id("s"); // a single call (only Integer) compiles
return b;
}
}
-13
View File
@@ -1,13 +0,0 @@
import java.lang.Integer;
import java.lang.Object;
import java.lang.System;
import java.io.PrintStream;
public class Bug466 {
public void p(Object o) { System.out.println(o.toString()); }
public run() {
var a = 3;
p(-(a + 10)); // Java: -13
}
public static main(args) { new Bug466().run(); }
}
+7 -4
View File
@@ -1808,9 +1808,12 @@ public class TestComplete {
}
@Test
public void testBug466() throws Exception {
var classFiles = generateClassFiles(createClassLoader(), "Bug466.jav");
var clazz = classFiles.get("Bug466");
clazz.getDeclaredMethod("main", List.class).invoke(null, List.of());
public void testBug460() throws Exception {
ConsoleInterface.logLevel = LogLevel.INFO;
var classFiles = generateClassFiles(createClassLoader(), "Bug460.jav");
var clazz = classFiles.get("Bug460");
var instance = clazz.getDeclaredConstructor().newInstance();
var run = clazz.getDeclaredMethod("run");
assertEquals("s", run.invoke(instance));
}
}