Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
08d57b0da4 |
No files matched your search
@@ -1,11 +0,0 @@
|
|||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
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(); }
|
||||||
|
}
|
||||||
@@ -1808,12 +1808,9 @@ public class TestComplete {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testBug460() throws Exception {
|
public void testBug466() throws Exception {
|
||||||
ConsoleInterface.logLevel = LogLevel.INFO;
|
var classFiles = generateClassFiles(createClassLoader(), "Bug466.jav");
|
||||||
var classFiles = generateClassFiles(createClassLoader(), "Bug460.jav");
|
var clazz = classFiles.get("Bug466");
|
||||||
var clazz = classFiles.get("Bug460");
|
clazz.getDeclaredMethod("main", List.class).invoke(null, List.of());
|
||||||
var instance = clazz.getDeclaredConstructor().newInstance();
|
|
||||||
var run = clazz.getDeclaredMethod("run");
|
|
||||||
assertEquals("s", run.invoke(instance));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user