Fix incorrect inheritance of private trait methods (#14163) The bug was introduced in c6b75f93289459b85923b104a071b464e031143f