Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
63a9239d1a |
No files matched your search
@@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1806,4 +1806,14 @@ public class TestComplete {
|
|||||||
var bnot = clazz.getDeclaredMethod("not", Integer.class);
|
var bnot = clazz.getDeclaredMethod("not", Integer.class);
|
||||||
assertEquals(-11, bnot.invoke(instance, 10));
|
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));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user