Fixed inheritance of type from parent type

Should fix issues/23212