Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change the condition when type parameters of an enum are added to a class case. Quoting my comment on scala#6095: We have the following possibilities: 1. type parameters are added only of there is no extends clause, 2. (all) type parameters are added if one of them is referenced in the case, 3. type parameters are always added if the case has value parameters (i.e. is not translated to an object). (1) is what the current rules say. (2) is what Adriaan proposed. (3) is what is currently implemented. In addition we have to clarify what should happen if a type parameter that is not added is nevertheless referred to in the case. Since enum expansion is done during desugaring, this could silently rebind to some other type. We should come up with a solution that avoids this, if possible. This PR changes the rules to implement (2).
- Loading branch information