-
-
Notifications
You must be signed in to change notification settings - Fork 16k
Specialization should allow for delegation to default trait method implementation #68309
Copy link
Copy link
Open
Labels
A-specializationArea: Trait impl specializationArea: Trait impl specializationC-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.F-associated_type_defaults`#![feature(associated_type_defaults)]``#![feature(associated_type_defaults)]`F-specialization`#![feature(specialization)]``#![feature(specialization)]`T-langRelevant to the language teamRelevant to the language team
Description
Activity
Metadata
Metadata
Assignees
Labels
A-specializationArea: Trait impl specializationArea: Trait impl specializationC-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.F-associated_type_defaults`#![feature(associated_type_defaults)]``#![feature(associated_type_defaults)]`F-specialization`#![feature(specialization)]``#![feature(specialization)]`T-langRelevant to the language teamRelevant to the language team
Given the following trait:
To provide a default specialization on
Trait::test,testmust be redefined;However this violates the DRY principle. The solution here would be to provide a way to delegate the implementation of
testto the already existing default implementation found in the trait definition.Proposed syntax to allow for this delegation: