Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[extension types] Member conflicts ignore precluded members (#3486)
Adjust the rules about extension type member conflicts: precluded members do not create conflicts. This PR changes the rule about member conflicts such that a member which is precluded does not conflict with any other members. It is an adjustment of the rules added by #3470. For example, if an extension type `E1` declares a method named `m` and an extension type `E2` declares a setter named `m=` and has `implements E1`, then `E2` does not "inherit" the method named `m` (it is precluded because it would conflict with the setter). In this PR we add an extra rule which says that it is not a conflict if `E2` has two superinterfaces `E1a` and `E1b`, and `E1a` declares a method named `m` and `E1b` declares a getter named `m`, and `E2` again declares a setter named `m=` and has `implements E1a, E1b`. The point as that `E2` will "inherit" the getter (so it has a full setter/getter pair), but not the method (because it is precluded by the setter), and (here comes the new thing) the method is ignored during conflict checks because it is precluded, so we avoid the useless error about `m` being ambiguous that we'd otherwise have because of `implements E1a, E1b`.
- Loading branch information