changeset 1168:d4ea063b55af

7085024: internal error; cannot instantiate Foo Reviewed-by: mcimadamore
author dmeetry
date Sat, 15 Oct 2011 19:20:15 +0400
parents 8031a8112618
children 94bb9583fe28
files src/share/classes/com/sun/tools/javac/code/Types.java test/tools/javac/7085024/T7085024.java test/tools/javac/7085024/T7085024.out
diffstat 3 files changed, 18 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/com/sun/tools/javac/code/Types.java	Sat Oct 15 17:40:24 2011 +0400
+++ b/src/share/classes/com/sun/tools/javac/code/Types.java	Sat Oct 15 19:20:15 2011 +0400
@@ -269,10 +269,12 @@
 
     // <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) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/7085024/T7085024.java	Sat Oct 15 19:20:15 2011 +0400
@@ -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 );
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/7085024/T7085024.out	Sat Oct 15 19:20:15 2011 +0400
@@ -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