提交 1e34e922 编写于 作者: M mcimadamore

8016640: compiler hangs if the generics arity of a base class is wrong

Summary: Check.checkCompatibleConcretes hang when javac creates synthetic supertypes for 269 model API
Reviewed-by: jjg
上级 4d5a4c58
......@@ -2245,7 +2245,7 @@ public class Types {
@Override
public Type visitErrorType(ErrorType t, Void ignored) {
return t;
return Type.noType;
}
};
// </editor-fold>
......
......@@ -46,6 +46,7 @@ import com.sun.tools.javac.code.Symbol;
import com.sun.tools.javac.code.Symbol.*;
import com.sun.tools.javac.code.Type;
import com.sun.tools.javac.code.Type.ClassType;
import com.sun.tools.javac.code.TypeTag;
import com.sun.tools.javac.comp.AttrContext;
import com.sun.tools.javac.comp.Env;
import com.sun.tools.javac.tree.JCTree;
......@@ -516,7 +517,7 @@ public class ClassDocImpl extends ProgramElementDocImpl implements ClassDoc {
return null;
Type sup = env.types.supertype(type);
return TypeMaker.getType(env,
(sup != type) ? sup : env.syms.objectType);
(sup.hasTag(TypeTag.NONE)) ? env.syms.objectType : sup);
}
/**
......
/*
* @test /nodynamiccopyright/
* @bug 8016640
* @summary compiler hangs if the generics arity of a base class is wrong
* @compile/fail/ref=T8016640.out -XDrawDiagnostics T8016640.java
*/
class T8016640 {
static class Foo<X,Y> { }
static class BadFoo<T> extends Foo<T> { }
}
T8016640.java:9:39: compiler.err.wrong.number.type.args: 2
1 error
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册