提交 a7b779e7 编写于 作者: M mcimadamore

7085024: internal error; cannot instantiate Foo

Summary: Types.isConvertible does not handle erroneous types correctly
Reviewed-by: jjg
上级 8ec74a07
......@@ -269,10 +269,12 @@ public class Types {
// <editor-fold defaultstate="collapsed" desc="isConvertible">
/**
* Is t a subtype of or convertiable via boxing/unboxing
* convertions to s?
* Is t a subtype of or convertible via boxing/unboxing
* conversion to s?
*/
public boolean isConvertible(Type t, Type s, Warner warn) {
if (t.tag == ERROR)
return true;
boolean tPrimitive = t.isPrimitive();
boolean sPrimitive = s.isPrimitive();
if (tPrimitive == sPrimitive) {
......
/*
* @test /nodynamiccopyright/
* @bug 7085024
* @summary internal error; cannot instantiate Foo
* @compile/fail/ref=T7085024.out -XDrawDiagnostics T7085024.java
*/
class T7085024 {
T7085024 (boolean ret) { } //internal error goes away if constructor accepts a reference type
T7085024 f = new T7085024((NonExistentClass) null );
}
T7085024.java:11:32: compiler.err.cant.resolve.location: kindname.class, NonExistentClass, , , (compiler.misc.location: kindname.class, T7085024, null)
1 error
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册