-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
Closed as not planned
Labels
C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
Normally generics should just work like specialized versions, just substituted with the correct type.
For example trait MyTrait<T> {…} is intended to work for a type MyType as if I defined trait MyTrait_MyType {…}.
This doesn't apply, when one specialized version of a generic trait is implemented for a type T, which derefs to U, which implements a different specialization of the same trait.
Then the specialized version for T also shadows the specialized version for U, even if they could both be called on this type.
I made an example to show, what this means here.
Metadata
Metadata
Assignees
Labels
C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.