Compare commits

..
2 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
dholle cbfda2da47 Merge pull request 'Fix #436' (#469) from fix-436 into master
SonarQube Scan / SonarQube Trigger (push) Successful in 2m26s
Reviewed-on: #469
2026-11-17 10:41:44 +00:00
2 changed files with 21 additions and 0 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;
}
}
+10
View File
@@ -1806,4 +1806,14 @@ public class TestComplete {
var bnot = clazz.getDeclaredMethod("not", Integer.class);
assertEquals(-11, bnot.invoke(instance, 10));
}
@Test
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));
}
}