if (redirectedElement == null) {
//
// If the element is null, we check for the REDIRECT_TO_MISSING_CONSTRUCTOR case
//
TypeName constructorTypeName = redirectedConstructor.getType();
Type redirectedType = constructorTypeName.getType();
if (redirectedType != null && redirectedType.getElement() != null
&& !redirectedType.isDynamic()) {
//
// Prepare the constructor name
//
String constructorStrName = constructorTypeName.getName().getName();
if (redirectedConstructor.getName() != null) {
constructorStrName += '.' + redirectedConstructor.getName().getName();
}
ErrorCode errorCode = node.getConstKeyword() != null
? CompileTimeErrorCode.REDIRECT_TO_MISSING_CONSTRUCTOR
: StaticWarningCode.REDIRECT_TO_MISSING_CONSTRUCTOR;
errorReporter.reportErrorForNode(
errorCode,
redirectedConstructor,
constructorStrName,
redirectedType.getDisplayName());
return true;
}
return false;
}
FunctionType redirectedType = redirectedElement.getType();
Type redirectedReturnType = redirectedType.getReturnType();
//
// Report specific problem when return type is incompatible
//
FunctionType constructorType = node.getElement().getType();
Type constructorReturnType = constructorType.getReturnType();
if (!redirectedReturnType.isAssignableTo(constructorReturnType)) {
errorReporter.reportErrorForNode(
StaticWarningCode.REDIRECT_TO_INVALID_RETURN_TYPE,
redirectedConstructor,
redirectedReturnType,