if( ClassObjectType.DroolsQuery_ObjectType.isAssignableFrom( resolved.getPattern().getObjectType() ) ) {
// if the resolved still points to DroolsQuery, we know this is the first unification pattern, so redeclare it as the visible Declaration
declr = pattern.addDeclaration( declr.getIdentifier() );
// this bit is different, notice its the ArrayElementReader that we wire up to, not the declaration.
ArrayElementReader reader = new ArrayElementReader( new SelfReferenceClassFieldReader(Object[].class, "this"),
qe.getDeclIndexes()[i],
resolved.getExtractor().getExtractToClass() );
declr.setReadAccessor( reader );