If field resolution isn’t available, don’t try to make a symbol for the constructor (typemirrors).

This commit is contained in:
Reinier Zwitserloot committed 2017-01-20 00:37:31 +01:00
1 parent 5a7f02ca05
commit 00ce9a72e6
1 file changed
+9 -2
@@ -230,8 +230,15 @@ public class HandleConstructor {
JCMethodDecl constr = createConstructor(staticConstrRequired ? AccessLevel.PRIVATE : level, onConstructor, typeNode, fields, allToDefault, suppressConstructorProperties, source);
ListBuffer<Type> argTypes = new ListBuffer<Type>();
for (JavacNode fieldNode : fields) argTypes.append(getMirrorForFieldType(fieldNode));
List<Type> argTypes_ = argTypes.toList();
for (JavacNode fieldNode : fields) {
Type mirror = getMirrorForFieldType(fieldNode);
if (mirror == null) {
argTypes = null;
break;
}
argTypes.append(mirror);
}
List<Type> argTypes_ = argTypes == null ? null : argTypes.toList();
injectMethod(typeNode, constr, argTypes_, Javac.createVoidType(typeNode.getSymbolTable(), CTC_VOID));
if (staticConstrRequired) {
ClassSymbol sym = ((JCClassDecl) typeNode.get()).sym;