make getReference work for inheritance types