[DROOLS-640] fix type declarations when declaring a class with a subclass-typed attribute