* @param expression the expression to be tested for a deferred library reference
* @param errorCode the error code to be used if the expression is or consists of a reference to a
* deferred library
*/
private void reportErrorIfFromDeferredLibrary(Expression expression, ErrorCode errorCode) {
DeferredLibraryReferenceDetector referenceDetector = new DeferredLibraryReferenceDetector();
expression.accept(referenceDetector);
if (referenceDetector.getResult()) {
errorReporter.reportErrorForNode(errorCode, expression);
}
}