# HG changeset patch # User mcimadamore # Date 1314803488 -3600 # Node ID c8f32009b413822cdbf35db6d8b8be232fb199e2 # Parent de9223c94f9c710b3eebb599cd3586f36c8b94a9 7085024: internal error; cannot instantiate Foo Summary: Types.isConvertible does not handle erroneous types correctly Reviewed-by: jjg diff -r de9223c94f9c -r c8f32009b413 langtools/src/share/classes/com/sun/tools/javac/code/Types.java --- a/langtools/src/share/classes/com/sun/tools/javac/code/Types.java Wed Jul 05 17:48:14 2017 +0200 +++ b/langtools/src/share/classes/com/sun/tools/javac/code/Types.java Wed Aug 31 16:11:28 2011 +0100 @@ -269,10 +269,12 @@ // /** - * 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) { diff -r de9223c94f9c -r c8f32009b413 langtools/test/tools/javac/7085024/T7085024.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/langtools/test/tools/javac/7085024/T7085024.java Wed Aug 31 16:11:28 2011 +0100 @@ -0,0 +1,12 @@ +/* + * @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 ); +} diff -r de9223c94f9c -r c8f32009b413 langtools/test/tools/javac/7085024/T7085024.out --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/langtools/test/tools/javac/7085024/T7085024.out Wed Aug 31 16:11:28 2011 +0100 @@ -0,0 +1,2 @@ +T7085024.java:11:32: compiler.err.cant.resolve.location: kindname.class, NonExistentClass, , , (compiler.misc.location: kindname.class, T7085024, null) +1 error