-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Pattern-bound type refs should have Case flag set #6172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I don't know what this does but the description of this flag is manifestly incomplete: Could you update it to explain what Case does on a val ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we're going with what @smarter proposed, then how about the following?
/** A symbol related to pattern matching */
final val Case: FlagSet = commonFlag(17, "case")
/** Case class or pattern-bound type symbol. */
final val CaseType: FlagSet = Case.toTypeFlags
/** Case class' companion object or pattern-bound term symbol */
final val CaseVal: FlagSet = Case.toTermFlags
Refactoring necessary to change usages of CaseClass
(which doesn't really mark solely case classes).
Sounds like these two usages of the flag are completely unrelated, so it'd be clearer to use two flags (we're not running out of bits for them yet). |
I agree that it looks like we have two distinct uses of the same flag here. I think that using |
I think it was just done for convenience and there's no deep reason for it, you have my blessing to add a |
We are not that far to running out of flags, so I vote for keeping a single |
@odersky I'll add a comment to this PR. |
OK, in that case maybe call the flag |
@smarter OK, but I'd rather do that in a followup PR. |
Follow on issue here, assigned to me. Any objections if I merge this now? |
Comments addressed either here or TBD in follow on issue.
Fixes #6157.