Fixed overriding for classes with self type #SCL-6279 Fixed